JDK-8365055 : G1: Merge Heap Roots phase incorrectly clears young gen remembered set every time
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 25
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-08-07
  • Updated: 2025-08-28
  • Resolved: 2025-08-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 26
26 masterFixed
Related Reports
Causes :  
Description
During merging heap roots the existing code always updates the young gen length and clears the young gen remembered set card set.

In case of optional evacuation, this causes some bugs:
* after the initial evacuation, the young gen card set is empty, i.e. occupied is empty, and so the value passed to the predictors zero. Messes up the predictions a fair bit.
* clearing the young gen card set every merge heap root clears the regions associated with the young gen remset. Current code does not use them except for logging, so logging is wrong.

Fortunately no cards are added to the young gen remset during evacuation, so there is no risk of missing remembered sets.
Comments
Changeset: d06c66f7 Branch: master Author: Thomas Schatzl <tschatzl@openjdk.org> Date: 2025-08-28 09:21:26 +0000 URL: https://git.openjdk.org/jdk/commit/d06c66f7f5a6d3c649c0a10ad735f0cc7c673b2a
28-08-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/26695 Date: 2025-08-08 12:09:07 +0000
08-08-2025