RFR: 8367708: GenShen: Reduce total evacuation burden

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


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.

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

Commit messages:
 - Merge remote-tracking branch 'jdk/master' into combined-evac-improvements
 - Merge remote-tracking branch 'origin/master' into combined-evac-improvements
 - Merge branch 'openjdk:master' into master
 - Merge branch 'openjdk:master' into master
 - Merge branch 'openjdk:master' into master
 - manualy resolve evac tracker diffs
 - Merge remote-tracking branch 'jdk/master' into combined-evac-improvements
 - Merge remote-tracking branch 'jdk/master' into combined-evac-improvements-gh
 - Only defragment old if non-zero humongous reserve
 - Less aggressive compaction of old
 - ... and 40 more: https://git.openjdk.org/jdk/compare/5271448b...6fc458aa

Changes: https://git.openjdk.org/jdk/pull/27278/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27278&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8367708
  Stats: 50 lines in 6 files changed: 29 ins; 5 del; 16 mod
  Patch: https://git.openjdk.org/jdk/pull/27278.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27278/head:pull/27278

PR: https://git.openjdk.org/jdk/pull/27278


More information about the hotspot-gc-dev mailing list