JDK-8219621 : G1 concurrent class unloading is disabled during high class loading activity
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 12,13
  • Priority: P2
  • Status: Closed
  • Resolution: Not an Issue
  • Submitted: 2019-02-24
  • Updated: 2019-02-24
  • Resolved: 2019-02-24
Related Reports
Relates :  
Description
In [~huntch]'s (internal) class loading/unloading stress test G1 starts failing to unload classes during concurrent cycles after a short while.

Only Full GCs with a cause of "Metadata GC Threshold" when metaspace reaches MaxMetaspaceSize can clear out metaspace.

If there is no MaxMetaspaceSize set it is expected that the metaspace will grow until the process is killed or there is a different reason for a full gc.

After that G1 will never be able to clean out metaspace using concurrent cycles. (This may be because the test program does the same forever from that point on).

Only reproduces with release builds. JDK11 does not show the issue - it cleans out metaspace regularly using concurrent cycles.

The change that started this behavior to show up is JDK-8210155: Lock ClassLoaderDataGraph . It may not be directly responsible for that.
Comments
Some further investigation indicates that this is likely an issue with metaspace fragmentation; the mentioned change may just change allocation behavior enough to look like if there is a different issue. Closing this CR.
24-02-2019

Added gc+metaspace=info output grepped for "Metaspace:" sizes for r51607 (good.txt) and r51608 (bad.txt)
24-02-2019