RFR: Enforce max regions

William Kemper wkemper at openjdk.org
Tue Dec 6 22:03:18 UTC 2022


On Tue, 6 Dec 2022 17:57:18 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:

> This commit enforces upper bounds on the number of ShenandoahHeapRegions affiliated with each generation.  Prior to this change, enforcement of generation sizes was by usage alone.  This allowed situations in which so many sparsely populated regions were affiliated with old-gen that there were insufficient FREE regions available to satisfy legitimate young-gen allocation requests.  This was resulting in excessive TLAB allocation failures and degenerated collections.

src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp line 1031:

> 1029:     // affiliation to OLD_GENERATION and adjust the generation-use tallies.  The remnant of memory
> 1030:     // in the last humongous region that is not spanned by obj is currently not used.
> 1031:     for (size_t i = index(); i < index_limit; i++) {

Do we need to worry about races here? Could we have a separate evacuating thread take a new, old region to use for PLABs _after_ we checked old available regions?

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

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


More information about the shenandoah-dev mailing list