RFR: 8277930: Add unsafe allocation event to jfr [v8]
Erik Gahlin
egahlin at openjdk.java.net
Tue Dec 7 08:16:18 UTC 2021
On Tue, 7 Dec 2021 06:21:54 GMT, xpbob <duke at openjdk.java.net> wrote:
>> Unsafe is used in many Java frameworks.
>> When the framework has a unsafe memory leak , there is no way to know what code is causing it.
>> Add unsafe allocation event to jfr.
>> Records the size and stack allocated.
>> This event is off by default
>
> xpbob has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 10 additional commits since the last revision:
>
> - Merge branch 'openjdk:master' into JDK-8277930
> - add new line for file
> - remove whitespace
> - remove event in metadata
> - add java event
> - Merge branch 'openjdk:master' into JDK-8277930
> - remove whitespace
> - add free and Reallocate event
> - Merge branch 'openjdk:master' into JDK-8277930
> - 8277930: Add unsafe allocation event to jfr
Nice to see the runtime cost being eliminated when JFR is disabled.
Each additional Java event adds startup cost, and we have been reluctant to add more JFR events, until we have a solution for this. It's not just these events, but others as well.
My plan is to reduce the startup cost by eliminating the need for the handler classes and weave the bytecode at build time. The task is high priority as it blocks several enhancements. I've already done some prototyping, and plan is to have this in place for JDK 19, but no guarantees.
There will be another mechanism than the Handlers class to avoid allocation.
My suggestion is to revisit this PR when it has been checked in.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6591
More information about the hotspot-jfr-dev
mailing list