RFR: Coalesce and fill old, pinned regions after old gen final mark

Y. Srinivas Ramakrishna ysr at openjdk.org
Tue Jul 5 20:37:08 UTC 2022


On Tue, 5 Jul 2022 16:54:43 GMT, William Kemper <wkemper at openjdk.org> wrote:

> Pinned regions were not being coalesced and filled. This fixes a crash observed with the specjbb 2015 benchmark.

Other than the comment I left inline, the change looks good; great catch finding the bug!

src/hotspot/share/gc/shenandoah/heuristics/shenandoahOldHeuristics.cpp line 215:

> 213:         region->begin_preemptible_coalesce_and_fill();
> 214:         candidates[cand_idx]._region = region;
> 215:         candidates[cand_idx]._garbage = 0;

Newbie question:

Assume that the object gets unpinned prior to the next marking, and assume hypothetically that the region in question had mostly garbage (let's pick 99% garbage for the sake of argument). At region unpinning, do we sort it into the right position of the garbage first list after recomputing its garbage field?

In other words, I am wondering if we make the `_garbage` field indicate the correct value, but skip adding a pinned region to the collection set when the collection set is built? It looks like the protocol for meaning of the state `_cset_pinned`already accounts for regions being in the collection set while being pinned, so won't that protocol handle this already without having to sort pinned regions to the bottom of the garbage-first list or avoiding adding them to the collection set?

-------------

PR: https://git.openjdk.org/shenandoah/pull/149


More information about the shenandoah-dev mailing list