RFR: 8367993: G1: Speed up ConcurrentMark initialization [v9]

Stefan Johansson sjohanss at openjdk.org
Fri Jan 30 12:50:17 UTC 2026


On Thu, 29 Jan 2026 14:47:12 GMT, Leo Korinth <lkorinth at openjdk.org> wrote:

>> This change moves almost all of the ConcurrentMark initialisation from its constructor to the method `G1ConcurrentMark::fully_initialize()`.  Thus, creation time of the VM can be slightly improved by postponing creation of ConcurrentMark. Most time is saved postponing creation of statistics buffers and threads.
>> 
>> It is not obvious that this is the best solution. I have earlier experimented with lazily allocating statistics buffers _only_. One could also initialise a little bit more eagerly (for example the concurrent mark thread) and maybe get a slightly cleaner change. However IMO it seems better to not have ConcurrentMark "half initiated" with a created mark thread, but un-initialised worker threads.
>> 
>> This change is depending on the integration of https://bugs.openjdk.org/browse/JDK-8373253.
>> 
>> I will be out for vacation, and will be back after new year (and will not answer questions during that time), but I thought I get the pull request out now so that you can have a look.
>
> Leo Korinth has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Reapply "remove commented out code"
>    
>    This reverts commit d0d1860058f0dae7813c3e5115e2784da8331f3b.
>  - Reapply "Stefan J 4"
>    
>    This reverts commit c5a7e2bb44ce111f8c8d1d7f728f1bf8013475e0.

Ship it!

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

Marked as reviewed by sjohanss (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28723#pullrequestreview-3728110245


More information about the hotspot-dev mailing list