RFR: 8373225: GenShen: More adaptive old-generation growth heuristics [v5]
Kelvin Nilsen
kdnilsen at openjdk.org
Thu Dec 11 21:25:05 UTC 2025
On Thu, 11 Dec 2025 15:46:19 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:
>> src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp line 65:
>>
>>> 63: "(Generational mode only) If the usage within old generation " \
>>> 64: "has grown by at least this percent of its live memory size " \
>>> 65: "at the start of the previous old-generation marking effort, " \
>>
>> Did you intend to say "at the _end_ of the previous old-generation marking effort" above?
>
> Actually, since we are using SATB protocol for old marking, the live data is measured as of the start of GC. (We subtract out the allocations (promotions) that happen during concurrent GC.
It's been my intention to use a SATB measurement of live data, but it looks like that's not yet implemented. Would like to leave as is for now. Will address this in a future PR. For preservation of thoughts on how to do this:
1. At ShenandoahConcurrentGC::op_init_mark(), when we parallel_heap_region_iterate() over ShenandoahInitMarkUpdateRegionStateClosure, we can capture for each heap its "current usage"
2. At ShenandoahOldHeuristics::prepare_for_old_colections(), this is where we currently set_live_bytes_at_last_mark() to the current live in old.
3. At this point, I would like to compute for each old region the difference between its current old used and its old-used-at-start-of-gc (this represents new allocations (promotions) that happened during concurrent old marking). Subtract the sum of these differences from the live memory calculated today. This represents the true live memory at start of old marking (according to SATB theory).
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28561#discussion_r2612115759
More information about the hotspot-gc-dev
mailing list