RFR: Generational support for weak roots and references
William Kemper
wkemper at openjdk.java.net
Thu Jul 29 18:50:13 UTC 2021
On Thu, 22 Jul 2021 22:53:56 GMT, William Kemper <wkemper at openjdk.org> wrote:
> ### Summary
> The LRB for non-strong references is modified to permit resurrection of objects outside the generation being collected. In other words, resurrection is only blocked for unmarked objects in the generation being collected.
>
> Each `ShenandoahGeneration` has its own reference processor instance. In some cases, a reference from the old generation may end up on the young generation discovered list if the reference points to a young referent (this would happen if the old reference is in the remembered set). However, young references that point to referents in the old generation are _not_ discovered. This has the effect of strongly marking the old generation referent. This also avoids the case of having young references on the old generation discovered list being evacuated/relocated while they wait for old generation reference processing (although we believe this case would be handled correctly by the existing update references code).
There are `is_marked_or_old` methods in `MarkingContext` for use with the verifier (because it visits all objects, even when it's run during a young collect). I think so long as we want to process weak references in young collections _and_ old collections we need to maintain two discovered lists. I can see a way through this where we process references in young and _global_ collections (i.e., entire heap) using one discovered list (since young and global collections cannot overlap).
-------------
PR: https://git.openjdk.java.net/shenandoah/pull/53
More information about the shenandoah-dev
mailing list