RFR: 8375359: Improve GC serviceability init staging
Stefan Karlsson
stefank at openjdk.org
Mon Jan 26 13:36:12 UTC 2026
On Mon, 26 Jan 2026 12:55:50 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> > Is there a way to restructure the code so that we don't get more locations in the VM initialization code (external to the GC code) that call various CollectedHeap initialization functions?
>
> I have not looked deeply, but honestly, I doubt it would not introduce more bootstrapping issues. As it stands now, we are changing the init sequence only a little bit, and already when the rest of the system is initialized. Moving serviceability inits way up to `CollectedHeap::initialize` moves it before a lot of other inits, so there is IMO a risk there. Bootstraping sequence is fiddly and always comes with surprises.
>
> For example, AFAICS, after `CollectedHeap::initialize` completes, we have not yet initialized Metaspace including its perf counters, String table is not yet wired up, etc. It is plausible serviceability code would need some of that, maybe is some future changes.
>
> So I'd prefer to keep the patch as it is.
You are right that the PerfCounters are problematic. The pools and memory mangers could probably be moved though. Oh well, I'll create an RFE and deal with that after you have integrated.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/29254#issuecomment-3799630787
More information about the hotspot-dev
mailing list