RFR: 8241605: Shenandoah: More aggressive reference discovery
Roman Kennke
rkennke at redhat.com
Wed Mar 25 17:29:21 UTC 2020
Shenandoah uses SATB for concurrent marking, and thus needs to track
stores and explicitely make previous values grey. An exception to this
are (soft/weak/final) references: the reachability of referents can be
changed (from weak to strong) when a referent is accessed. For this
reason we require a keep-alive barrier which also makes referents grey
whenever they are accessed via Reference.get(). The downside of this is
if a workload churns weak-references (i.e. accesses them often) they
might never get a chance to be reclaimed.
The key insight for improving the situation is that the change of
reachability of the referent is only relevant when that referent is
stored somewhere else. We can elide the keep-alive barrier, if the
compiler can prove that this doesn't happen. (We also need to check if
the referent leaves the scope of the method via method-call or return,
because it may be stored outside of the method.) The caveat here is that
we must do another scan of the threads' stacks at final-mark to catch
referents that are in a local variable at final-mark - we must not loose
those. However, according to my measurements, this is only a minor (if
any) regression in final-mark-latency.
Issue:
https://bugs.openjdk.java.net/browse/JDK-8241605
Webrev:
http://cr.openjdk.java.net/~rkennke/JDK-8241605/webrev.00/
Testing: hotspot_gc_shenandoah (including new testcase that verifies the
improved behaviour), manual tests, specjbb and specjvm runs
I'd like to push this to shenandoah/jdk first, to give it a few more
rounds of testing before hitting mainline JDK.
Ok?
Roman
More information about the hotspot-gc-dev
mailing list