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.
- 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.
- relates to
-
JDK-8368080 G1: Unnecessary initialization of G1CMTask's mark stats table
-
- Open
-
-
JDK-8071277 G1: Merge commits and uncommits of contiguous memory
-
- Open
-
-
JDK-8367992 Card table clearing during commit significantly slows down VM startup
-
- Open
-
-
JDK-8348270 G1 is slow at startup due to initial heap commits
-
- Closed
-
-
JDK-8359802 JEP 523: Make G1 the Default Garbage Collector in All Environments
-
- Candidate
-