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:05:09 GMT, Andrew Haley <aph at openjdk.org> wrote:
> > I ran some benchmarks as well: http://cr.openjdk.java.net/~jvernee/UnsafeTest.java
> > I see about a 6 ns increase in benchmark times with the new coded added in (regardless of allocation size), which sounds about right. An unsafe allocation and free takes about 90 ns on my machine with the latest JDK, so the regression is ~6%. (I'm not sure if that's worth worrying about, see below).
>
> Computers can get a lot done in 6ns. Why can't the JFR event be conditional on a simple flag?
If they are written like this, it should be a simple check:
EventUnsafeReallocate event;
if (event.should_commit()) {
event.set_allocationSize(sz);
event.set_freeAddr(addr);
event.set_allocAddr(reallocAddr);
event.commit()
}
-------------
PR: https://git.openjdk.java.net/jdk/pull/6591
More information about the hotspot-jfr-dev
mailing list