RFR: Handle metadata induced GC

Zhengyu Gu zgu at redhat.com
Wed Oct 24 19:08:49 UTC 2018


When metaspace usage over certain threshold, it notifies GC to schedule 
a GC cycle to cleanup metaspace, e.g. unload classes.

Currently, Shenandoah does not handle metadata induced GC, as the 
results, it fails some of metaspace tests, due to metaspace OOM.

To address this issue, we need to a mechanism to schedule asynchronous 
GC, so that, it does not block metadata allocation when threshold is 
reached, allows asynchronous GC to cleanup metaspace in background, and 
only force a full GC when metaspace OOM is actually reached.

The patch also refactors run_service() routine, to make it a little easy 
to manage.

We might need a queue for synchronous GC requests, to ensure orders(?).
So far, I have yet seen contentions. But if needed, I would prefer in 
followup RFE.

Webrev: 
http://cr.openjdk.java.net/~zgu/shenandoah/metadata_gc/webrev.00/index.html

Test:
   tier3_gc_shenandoah (fastdebug and release)

   vmTestbase/metaspace:

still has 3 failures, due to GC counters over expected ranges.
For example:
	metaspace.gc.Fault: GC has happened 31 times, approximate count is 3 to 30

Will look into them next.


Thanks,

-Zhengyu


More information about the shenandoah-dev mailing list