RFR (M): 8218880: G1 crashes when issuing a periodic GC while the GCLocker is held

Thomas Schatzl thomas.schatzl at oracle.com
Wed Feb 27 09:29:47 UTC 2019

Hi all,

  can I have reviews for this change that fixes execution of periodic
GCs in G1?

In the current implementation, if periodic GC is triggered when the gc
locker is held, the VM crashes because the GC locker is supposed to be
only held by Java threads - but the periodic GCs are triggered by some
GC thread.

The fix is to ignore the periodic GC request if the GC locker is held -
after all this means that the application is active anyway, and a GC
will be triggered anyway as soon as the critical section ends.

To make it clear to end users that the periodic GC has been cancelled
due to that reason, the change prints a cancellation reason too if
appropriate logging is enabled.

The change itself is pretty small, it's just the test that's a bit
longer but straightforward.

I will backport this to 12u later.

New test case, hs-tier1-5


More information about the hotspot-gc-dev mailing list