Integrated: 8365055: G1: Merge Heap Roots phase incorrectly clears young gen remembered set every time

Thomas Schatzl tschatzl at openjdk.org
Thu Aug 28 09:26:59 UTC 2025


On Fri, 8 Aug 2025 12:09:07 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

This pull request has now been integrated.

Changeset: d06c66f7
Author:    Thomas Schatzl <tschatzl at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/d06c66f7f5a6d3c649c0a10ad735f0cc7c673b2a
Stats:     23 lines in 5 files changed: 9 ins; 11 del; 3 mod

8365055: G1: Merge Heap Roots phase incorrectly clears young gen remembered set every time

Reviewed-by: kbarrett, iwalulya

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

PR: https://git.openjdk.org/jdk/pull/26695


More information about the hotspot-gc-dev mailing list