RFR: 8365055: G1: Merge Heap Roots phase incorrectly clears young gen remembered set every time [v2]
Kim Barrett
kbarrett at openjdk.org
Thu Aug 14 07:16:11 UTC 2025
On Fri, 8 Aug 2025 14:12:31 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 comment in verification code
> * move that G1Policy member to G1CollectedHeap as it's used to verify stuff in G1CollectedHeap (and not used elsewhere anyway)
Looks good.
-------------
Marked as reviewed by kbarrett (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/26695#pullrequestreview-3119291686
More information about the hotspot-gc-dev
mailing list