RFR: 8365956: GenShen: Adaptive tenuring threshold algorithm may raise threshold prematurely
William Kemper
wkemper at openjdk.org
Fri Aug 22 18:31:09 UTC 2025
On Fri, 22 Aug 2025 18:24:12 GMT, William Kemper <wkemper at openjdk.org> wrote:
> The adaptive tenuring algorithm has been modified to begin its evaluation of mortality rates from the current tenuring threshold. To compliment this change, objects must also now be strictly above the tenuring threshold to be promoted (instead of greater-than-or-equal).
src/hotspot/share/gc/shenandoah/shenandoahAgeCensus.cpp line 30:
> 28: #include "gc/shenandoah/shenandoahHeap.inline.hpp"
> 29:
> 30: ShenandoahAgeCensus::ShenandoahAgeCensus()
Many of the changes here are to facilitate unit testing.
src/hotspot/share/gc/shenandoah/shenandoahAgeCensus.cpp line 307:
> 305: // ignoring the mortality rates of any older cohorts (which may see
> 306: // higher mortality rates due to promotions).
> 307: upper_bound = MIN2(upper_bound, prev_tt);
This is a key change.
src/hotspot/share/gc/shenandoah/shenandoahAgeCensus.cpp line 331:
> 329: assert(tenuring_threshold == i + 1 || tenuring_threshold == upper_bound, "Error");
> 330: assert(tenuring_threshold >= lower_bound && tenuring_threshold <= upper_bound, "Error");
> 331: return i + 1;
This is a subtle change, but it prevents the algorithm from getting stuck on the first cohort.
src/hotspot/share/gc/shenandoah/shenandoahAgeCensus.hpp line 181:
> 179: // Return true if this age is above the tenuring threshold.
> 180: bool is_tenurable(uint age) const {
> 181: return age > tenuring_threshold();
Another key change. This prevents the algorithm from seeing higher mortality rates caused by promotions in the cohort at tenuring age.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26906#discussion_r2294394667
PR Review Comment: https://git.openjdk.org/jdk/pull/26906#discussion_r2294395207
PR Review Comment: https://git.openjdk.org/jdk/pull/26906#discussion_r2294396795
PR Review Comment: https://git.openjdk.org/jdk/pull/26906#discussion_r2294398888
More information about the shenandoah-dev
mailing list