JDK-8322415 : Release Note: G1: Balance Code Root Scan Phase During Garbage Collection
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 21.0.4-oracle,22
  • Priority: P4
  • Status: Resolved
  • Resolution: Delivered
  • Submitted: 2023-12-19
  • Updated: 2024-05-24
  • Resolved: 2023-12-20
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 21 JDK 22
21.0.4-oracleResolved 22Resolved
Description
The Code Root Scan Phase during garbage collection finds references to Java objects in compiled code. To speed up this process, G1 maintains a remembered set for compiled code that contains references into the Java heap. That is, every region contains a set of compiled code that contains references into it.

Assuming that such references are few, previous code used a single thread per region to iterate over a particular region's references, which poses a scalability bottleneck if the distribution of these references is very unbalanced.

G1 now distributes this code root scan work across multiple threads within regions, removing this bottleneck.