When using G1, a GCLocker GC (GCCause::_gc_locker) with the product flag GCLockerInvokesConcurrent turned on (fortunately not the default) will spin in try_collect while there is a concurrent marking cycle already in progress. This will block the JNI critical section exiter, as well as any other threads that are in GCLocker::stall_until_clear().
This is very similar behavior to an old CMS bug (JDK-6919638), though even worse in this case because it's a spin-wait rather than blocking on a monitor.
This is very similar behavior to an old CMS bug (
- relates to
-
JDK-8233280 Remove GCLockerInvokesConcurrent
-
- Resolved
-
-
JDK-6919638 CMS: ExplicitGCInvokesConcurrent misinteracts with gc locker
-
- Resolved
-
-
JDK-8232588 G1 concurrent System.gc can return early or late
-
- Resolved
-