RFR: 8373225: GenShen: More adaptive old-generation growth heuristics

William Kemper wkemper at openjdk.org
Mon Dec 8 16:44:57 UTC 2025


On Sat, 29 Nov 2025 01:10:02 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:

> When old-gen consumes a small percentage of heap size, trigger when old-gen expands by more than ShenandoahMinOldGenGrowthPercent, with default value 50%, from the live data in old at time of previous old-gen mark.
> 
> When old-gen consumes a larger percentage of heap size, we trigger when old-gen expands by more than  ShenandoahMinOldGenGrowthRemainingHeapPercent, with default value 25%, of the memory not live in old at the last marking of old.

Changes requested by wkemper (Reviewer).

src/hotspot/share/gc/shenandoah/heuristics/shenandoahOldHeuristics.hpp line 212:

> 210:   void slide_pinned_regions_to_front();
> 211:   bool all_candidates_are_pinned();
> 212:   void adjust_old_garbage_threshold();

A brief general comment about the algorithm here or in the implementation would be welcome. As I read it, we are lowering the region's garbage threshold as the occupancy in the old generation increases. Lowering the garbage threshold will increase the number of old regions selected for a mixed collection.

src/hotspot/share/gc/shenandoah/shenandoahOldGeneration.cpp line 252:

> 250:     (_live_bytes_after_last_mark + ((ShenandoahHeap::heap()->soft_max_capacity() - _live_bytes_after_last_mark)
> 251:                                     * ShenandoahMinOldGenGrowthRemainingHeapPercent / 100.0));
> 252:   size_t result = MIN2(threshold_by_relative_growth, threshold_by_growth_into_percent_remaining);

Are we comparing bytes to a percentage here? Not sure I understand the role of `FRACTIONAL_DENOMINATOR`.

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

PR Review: https://git.openjdk.org/jdk/pull/28561#pullrequestreview-3552965737
PR Review Comment: https://git.openjdk.org/jdk/pull/28561#discussion_r2599302961
PR Review Comment: https://git.openjdk.org/jdk/pull/28561#discussion_r2599331553


More information about the shenandoah-dev mailing list