JDK-8367993 : G1: Speed up ConcurrentMark initialization
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2025-09-18
  • Updated: 2025-09-19
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.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
In https://bugs.openjdk.org/browse/JDK-8348270?focusedId=14818136&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14818136 some investigation about the costs of clearing the card table (JDK-8367992) and doing batched commits (JDK-8071277) some methods show up in a perf profile:

          - 11.10% universe_init() ▒
            - 7.03% G1CollectedHeap::initialize() ▒
               + 2.53% G1ConcurrentMark::G1ConcurrentMark(G1CollectedHeap*, G1RegionToSpaceMapper*) ▒
               + 1.56% G1CollectedHeap::expand(unsigned long, WorkerThreads*) ▒
               + 0.88% WorkerThreads::initialize_workers() ▒
               + 0.76% ConcurrentGCThread::create_and_start(ThreadPriority) ▒ 

I.e. concurrent mark initialization (particularly the allocation and resetting of the per-thread mark stats), marking thread initialization shows up.

A nice reproducer would be:

$ java -XX:+UseG1GC -Xms2g -Xmx2g HelloWorld

(or higher heap sizes)

Ideally, initialization of ConcurrentMark should be moved to the first gc starting concurrent mark.