RFR: 8353115: GenShen: mixed evacuation candidate regions need accurate live_data [v9]
William Kemper
wkemper at openjdk.org
Mon Sep 29 16:49:37 UTC 2025
On Tue, 16 Sep 2025 21:29:34 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:
>> The existing implementation of get_live_data_bytes() and git_live_data_words() does not always behave as might be expected. In particular, the value returned ignores any allocations that occur subsequent to the most recent mark effort that identified live data within the region. This is typically ok for young regions, where the amount of live data determines whether a region should be added to the collection set during the final-mark safepoint.
>>
>> However, old-gen regions that are placed into the set of candidates for mixed evacuation are more complicated. In particular, by the time the old-gen region is added to a mixed evacuation, its live data may be much larger than at the time concurrent old marking ended.
>>
>> This PR provides comments to clarify the shortcomings of the existing functions, and adds new functions that provide more accurate accountings of live data for mixed-evacuation candidate regions.
>
> Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision:
>
> Fix compilation errors after merge
Suggest a small refactoring to reduce code duplication.
src/hotspot/share/gc/shenandoah/heuristics/shenandoahOldHeuristics.cpp line 91:
> 89: }
> 90:
> 91: // Between consecutive mixed-evacuation cycles, the live data within each candidate region may change due to
I think we could reduce some duplication and call `recalibrate_old_collection_candidates_live_memory` here if the function didn't have the side effect of updating `_live_bytes_in_unprocessed_candidates`. Perhaps the function could return `total_live_data` and be `const`?
-------------
Changes requested by wkemper (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/24319#pullrequestreview-3231974347
PR Review Comment: https://git.openjdk.org/jdk/pull/24319#discussion_r2353850889
More information about the hotspot-gc-dev
mailing list