RFR: Implement heuristics to switch between merged and separate update-refs phase
Roman Kennke
rkennke at redhat.com
Mon May 8 15:12:20 UTC 2017
We have two ways to update references now: during a separate phase right
after evacuation and piggy-backed on subsequent marking. Doing it in a
separate phase right after evac makes sense when the time to the next
cycle is long: in this case it would improve cache behaviour when
reading the brooks ptr, and reclaim the cset earlier and thus giving us
more room to breathe. On the other hand, when pressure is high and GC
cycles are running (almost) back-to-back, it's not that benefitial
because it would traverse the heap twice, and we are better off to
update references while we're marking.
This change implements a heuristic to switch between the two modes based
on pressure. It measures the gap between cycles (and keeps a short
moving-window history of it) and also measures how long marking and
update-refs take (incl. moving-window history) and decides whether or
not to do a separate or merged update-refs phase based on that. The
exact behaviour is controlled by ShenandoahMergeUpdateRefs[Min|Max]Gap
arguments. I hope the description of those make any sense ;-)
This also means that, at least when running with adaptive heuristics
(the default), the argument -XX:+/-ShenandoahUpdateRefsEarly is unused.
http://cr.openjdk.java.net/~rkennke/merge-uprefs/webrev.01/
<http://cr.openjdk.java.net/%7Erkennke/merge-uprefs/webrev.01/>
Testing: hotspot_gc_shenandoah, specjvm-compiler
Ok?
Roman
More information about the shenandoah-dev
mailing list