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

Thomas Schatzl tschatzl at openjdk.org
Mon Jan 12 15:32:39 UTC 2026


On Mon, 12 Jan 2026 14:21:06 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

>> 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.

An unrelated issue could be that the task is run too early, before initialization is completed. However `G1ServiceTask` prevents that to happen already. So I also do not think we should keep this unless there is a demonstrated issue.

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

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


More information about the hotspot-gc-dev mailing list