RFR: 8277930: Add unsafe allocation event to jfr [v5]
Thomas Stuefe
stuefe at openjdk.java.net
Thu Dec 2 10:47:24 UTC 2021
On Tue, 30 Nov 2021 11:04:44 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 five additional commits since the last revision:
>
> - 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
> When the framework has a unsafe memory leak , there is no way to know what code is causing it.
Just a note, this is tracked by NMT (category `mtOther`).
> Computers can get a lot done in 6ns. Why can't the JFR event be conditional on a simple flag?
Yes, I dislike paying for something I don't use. We have seen customers using these APIs a lot, so it can be a hot path. The fact that malloc is used is an implementation detail not known to everyone.
@egahlin
> I also wonder if the events should be called NativeAllocation, NativeReallocation and NativeFree, so they are not tied so hard to the Unsafe implementation.
But you would still limit this to allocations done by outside code, right? Otherwise, again, we have NMT for tracking native memory in the VM.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6591
More information about the hotspot-jfr-dev
mailing list