RFR: 8277930: Add unsafe allocation event to jfr [v5]

Erik Gahlin egahlin at openjdk.java.net
Thu Dec 2 10:57:24 UTC 2021


On Thu, 2 Dec 2021 10:43:56 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

> > 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.

Yes, NativeAllocation could be misleading, perhaps JavaNativeAllocation? There is already JavaExceptionThrow

-------------

PR: https://git.openjdk.java.net/jdk/pull/6591


More information about the hotspot-jfr-dev mailing list