RFR: Concurrent preclean

Aleksey Shipilev shade at redhat.com
Wed May 31 11:48:21 UTC 2017


Hi,

Lots of weak references is hard. Processing them during the pause is also hard.
For some applications I've tried, the pause is very long. While studying
reference processing code I realized we can do something that CMS already does
-- concurrently precleaning before diving into STW.

See:
 http://cr.openjdk.java.net/~shade/shenandoah/preclean/webrev.01/

For example, retaining a 10M WeakHashMap, before/after:
 http://cr.openjdk.java.net/~shade/shenandoah/preclean/before.txt
 http://cr.openjdk.java.net/~shade/shenandoah/preclean/after.txt

So the positive thing is that it moves a substantial part of pause to concurrent
mode. The downside is that it is in the middle between concmark and final mark,
which may accumulate more cruft in SATBs. But, with small reference count, the
new phase takes just a bit of time, and with lots of references, we still have
the net win. We can consider draining SATB during preclean later.

Testing: hotspot_gc_shenandoah, jcstress -m quick

-Aleksey



More information about the shenandoah-dev mailing list