RFR: 8365055: G1: Merge Heap Roots phase incorrectly clears young gen remembered set every time [v3]

Kim Barrett kbarrett at openjdk.org
Wed Aug 27 21:58:43 UTC 2025


On Wed, 27 Aug 2025 15:34:04 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> Hi all,
>> 
>>   please review this fix to G1 heap root merging that cleared the young gen remembered set multiple times (for every merging) and overwriting the most recent statistics for the number of young gen cards.
>> 
>> The latter is probably the more problematic, as it directly impacts young gen sizing statistics, potentially making young gen too large.
>> 
>> The fix is to move the two statements to the proper place - get current number of young gen cards at startup, clear the young gen remset when starting a new collection set - we do not need to do that earlier after all. Additionally we can add some (superfluous?) verification that during GC we really do not add to the young gen remset.
>> 
>> Testing: tier1-5
>> 
>> Thanks,
>>   Thomas
>
> Thomas Schatzl has updated the pull request incrementally with one additional commit since the last revision:
> 
>   * fix issue: remember the current young regions cset group occupancy much earlier

Marked as reviewed by kbarrett (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/26695#pullrequestreview-3161865188


More information about the hotspot-gc-dev mailing list