RFR: 8366865: Allocation GC Pauses Triggered after JVM has started shutdown [v7]

Jonas Norlinder duke at openjdk.org
Thu Sep 18 22:09:02 UTC 2025


On Thu, 18 Sep 2025 22:01:23 GMT, Jonas Norlinder <duke at openjdk.org> wrote:

>> Ivan Walulya has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 15 commits:
>> 
>>  - make universal
>>  - Merge remote-tracking branch 'upstream/master' into shutting_down_gcs
>>  - Merge remote-tracking branch 'upstream/master' into shutting_down_gcs
>>  - Merge remote-tracking branch 'upstream/master' into shutting_down_gcs
>>  - Revert
>>  - Thomas Review
>>  - return on timeout
>>  - Merge remote-tracking branch 'upstream/master' into shutting_down_gcs
>>  - timed wait
>>  - Merge remote-tracking branch 'upstream/master' into shutting_down_gcs
>>  - ... and 5 more: https://git.openjdk.org/jdk/compare/4c7c009d...1a53c207
>
> src/hotspot/share/services/cpuTimeUsage.cpp line 39:
> 
>> 37: 
>> 38: static inline jlong thread_cpu_time_or_zero(Thread* thread) {
>> 39:   assert(!thread->has_terminated(), "Cannot get cpu time for terminated thread: %zu", thread->osthread()->thread_id_for_printing());
> 
> Are we sure that the thread is never in a de-allocated state here? I discussed adding an assert like that in `os::thread_cpu_time` but @dholmes-ora pointed out that such asserts are in general dangerous as the they may have been dealloacted and the assert itself could result in a segmentation fault. That being said, maybe we know that all threads we could possibly poke at here in this point could be terminated but not deallocated?

The assert I had in mind was to check `_is_shutting_down`

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27190#discussion_r2361287062


More information about the hotspot-dev mailing list