RFR: Early update references phase

Roman Kennke rkennke at redhat.com
Tue Mar 28 14:57:55 UTC 2017

This implements an early reference updating phase after evacuation. It
linearily scans the heap and updates all from-space reference to
to-space references. It is ultimately controlled by the collector
policy, which now uses the ShenandoahUpdateRefsEarly flag.

The updating references phase consists of 3 sub-phases:

1. STW pre-update-refs: here we turn off evac, turn on update-refs, make
heap parsable (main reason to have a pause here!), set the
iteration-top-limits for later concurrent region scan.

2. Concurrent update-heap-refs: here we concurrently update references.
Each GC worker claims one region at a time, and uses a (modified)
marked_object_iterate() to update all refs.

3. STW post-update-refs: turn off update-refs, update all roots, reclaim
all cset regions

I currently see no way to avoid the additional pauses.

I tested it using SPECjvm using fastdebug and release, found no more issues.

Cancellation is not yet implemented, but should be easy to do (in cases
of cancelled update-refs, we must not reclaim the regions and need to
keep need_update_refs() to true, so that next conc-mark can pick up
where we left. However, the devil is in the details: we might not only
want to cancel due to OOM, but also on request of the heuristics that
wants to start another conc-mark. In this case there would be no point
to finish update-refs, when conc-mark can update the refs just as well.
That's why I left this part out for the first prototype.



More information about the shenandoah-dev mailing list