Integrated: 8375359: Improve GC serviceability init staging

Aleksey Shipilev shade at openjdk.org
Mon Feb 23 09:31:37 UTC 2026


On Thu, 15 Jan 2026 16:43:40 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> As per docs, `CollectedHeap::post_initialize` is for doing inits that should be done before general allocations are accepted. Currently, serviceability layer initialized there via the call to `CollectedHeap::initialize_serviceability`. This bug shows that after `CollectedHeap::post_initialize` returns, the rest of the serviceability layer had not been fully initialized yet. But GC code might assume general allocation path works at that point! So if that allocation path reports anything to the serviceability layer, it could encounter not yet fully initialized serviceability support and fail.
> 
> This readily manifests in improved Epsilon stress test. Improved test fails pretty consistently on my machines, and serves as a good regression test.
> 
> So the fix is to peel off serviceability initialization from post-init stage, and do it separately, before going (and finishing) `post_initialize`. Conveniently, we are nearly there, and "just" need to touch up a few things in `universe_post_init()`.
> 
> Additional testing:
>  - [x] Linux x86_64 server fastdebug, `gc/epsilon/TestInitAllocs.java`, 10x
>  - [x] Linux x86_64 server fastdebug, `hotspot_gc`

This pull request has now been integrated.

Changeset: a9542746
Author:    Aleksey Shipilev <shade at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/a9542746e7289fff6f4d5e7482e68e37c79e41d0
Stats:     101 lines in 8 files changed: 46 ins; 5 del; 50 mod

8375359: Improve GC serviceability init staging

Reviewed-by: ayang, tschatzl, stefank

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

PR: https://git.openjdk.org/jdk/pull/29254


More information about the hotspot-dev mailing list