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

Stefan Johansson sjohanss at openjdk.org
Fri Jan 23 08:01:45 UTC 2026


On Thu, 22 Jan 2026 16:04:46 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> src/hotspot/share/gc/g1/g1CollectedHeap.cpp line 2745:
>> 
>>> 2743:   // without its logging output interfering with the logging output
>>> 2744:   // that came from the pause.
>>> 2745:   if (should_start_concurrent_mark_operation) {
>> 
>> Did you try doing the initialization here? Would be kind of nice to only initialize CM if ever needed.
>
>> Did you try doing the initialization here? Would be kind of nice to only initialize CM if ever needed.
> 
> This currently does not work because `G1ClearBitmapClosure` unnecessarily calls `G1ConcurrentMark::clear_statistics()` (and `reset_top_at_mark_start()`). There is a CR out for fixing this (https://bugs.openjdk.org/browse/JDK-8371720), but I suggest to not further delay this change.
> 
> Edit: fixed link

Thanks for the details Thomas. Totally agree, this can be investigated and tested further as a follow-up.

Ship it!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28723#discussion_r2720029706


More information about the hotspot-gc-dev mailing list