RFR: 8277930: Add unsafe allocation event to jfr
Jorn Vernee
jvernee at openjdk.java.net
Mon Nov 29 14:42:03 UTC 2021
On Mon, 29 Nov 2021 12:06:02 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
An event like this would help to find allocation sites.
I'd suggest also adding an event for `Unsafe::freeMemory`, as well as recording the memory address in both event types. With that, it should be possible to match up allocations with frees, and leaks could be identified by looking for allocations that don't have a corresponding free with the same address.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6591
More information about the hotspot-dev
mailing list