RFR: 8367993: G1: Speed up ConcurrentMark initialization [v3]
Stefan Johansson
sjohanss at openjdk.org
Mon Jan 12 14:25:17 UTC 2026
On Fri, 9 Jan 2026 15:43:02 GMT, Leo Korinth <lkorinth at openjdk.org> wrote:
>> src/hotspot/share/gc/g1/g1PeriodicGCTask.cpp line 46:
>>
>>> 44: return false;
>>> 45: }
>>> 46:
>>
>> Why is this needed? The initial young collection will make sure concurrent marking gets initialized, right?
>
> I do not remember if it was `whitebox` or if it was `System.gc()`, or something else. Do you think it is problematic ignoring it or just not needed?
I see no reason for skipping a periodic GC because we have not yet initialized concurrent mark. If the user for example configured periodic full gc (not doing a periodic concurrent GC) we should not prevent this, just because no young collection has yet been done.
Also, there should be no problem starting a concurrent periodic collection from what I can tell, since this will trigger initialization of concurrent mark. I did a quick test to verify this is ok (and it is), but there can of course be some corner case that I'm missing. In that case I would like to understand the corner case better to see if we can come up with a better approach than skipping the periodic collections until a young GC has been triggered.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28723#discussion_r2682486918
More information about the hotspot-gc-dev
mailing list