Integrated: 8003216: Add JFR event indicating explicit System.gc() call

Erik Gahlin egahlin at
Thu Jun 10 14:13:56 UTC 2021

On Thu, 10 Jun 2021 08:24:54 GMT, Erik Gahlin <egahlin at> wrote:

> Hi,
> This is a continuation of a review that started before the pandemic. 
> In an offline discussion with Stefan Johansson, we looked into adding GC id to the SystemGC event, but it was not trivial. Still, it would make sense to have this event to see the stack trace of the System GC call. GC id can always be added as another enhancement. I added a field that indicates the status of -XX:+ExplicitGCInvokesConcurrent, to hint to users that the duration of the event may not be the time the GC took. 
> I only emit the event if a GC is triggered, so there is no need for a field -XX:+DisableExplicitGC which we talked about back then. The reason is that it could potentially create many events in the default configuration, for example if called every rendered frame. I also think users want to track calls that actually led to a GC. If there is a need for a second field, it could be added as another enhancement later.
> Testing: tier1/tier2 + test/jdk/jdk/jfr 
> Thanks
> Erik

This pull request has now been integrated.

Changeset: e11f70ae
Author:    Erik Gahlin <egahlin at>
Stats:     99 lines in 6 files changed: 99 ins; 0 del; 0 mod

8003216: Add JFR event indicating explicit System.gc() call

Reviewed-by: jbachorik, mgronlun, tschatzl



More information about the hotspot-gc-dev mailing list