RFR: 8367708: GenShen: Reduce total evacuation burden

Kelvin Nilsen kdnilsen at openjdk.org
Mon Sep 15 19:55:09 UTC 2025


On Mon, 15 Sep 2025 04:44:24 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:

> This PR provides several improvements that cumulatively reduce the amount of evacuation performed by GenShen compared to traditional Shenandoah. Specifically:
> 
> 1. Do not promote humongous arrays of primitive data.  Leaving these regions in the young generation allows them to be reclaimed more quickly when they become garbage.  There is no disadvantage to leaving these regions in the young generation as their contents does not need to be scanned by the garbage collector.
> 2. Change the default value of ShenandoahOldGarbageThreshold from 15% to 25%.  This results in smaller sets of candidate regions for mixed evacuation, less aggressive compaction of old generation.  This also increases the likelihood that a region will be promoted in place instead of promoted by evacuation.
> 3. Only promote regions in place if the used within a region exceeds ShenandoahGenerationalMinPIPUsage (default 30) percent of the heap region size.  This is enforced in combination with the preexisting requirement that the garbage within the region be less than ShenandoahOldGarbageThreshold (new default 25) percent of the heap region size.  This causes regions with very low utilization to be promoted by evacuation rather than promoted in place.  While the immediate effect of this change is to perform more copying when the region is promoted, the secondary effect is that this region does not need to be evacuated at a later time, after it has accumulate more live data, as part of an effort to defragment old-gen memory.
> 4. Only defragment old-gen memory if the command-line has requested non-zero reserves for humongous objects (ShenandoahGenerationalHumongousReserves).  Previously, we would invest in defragmenting old-gen memory every time we finished old-generation marking, even if ShenandoahGenerationalHumongousReserves equals zero.

The impact on overall SpecJBB scores has been minimal.

Compare top charts (proposed PR) with bottom charts (baseline). These charts show the maximum number of bytes evacuated by workers and mutators into the old generation (blue, purple) across all benchmarks (~20 executions of 6 benchmark suites) and platforms (x86, aarch64).  Green represents young bytes evacuated by workers; red is young bytes evacuated by mutators.  Young evacuations increase slightly with this reduction in old evacuations.

<img width="2531" height="1354" alt="image" src="https://github.com/user-attachments/assets/1ec1b300-abd2-49a8-9a63-312e821d60d8" />

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

PR Comment: https://git.openjdk.org/jdk/pull/27278#issuecomment-3293659081


More information about the hotspot-gc-dev mailing list