RFR: 8366865: Allocation GC Pauses Triggered after JVM has started shutdown [v7]
Ivan Walulya
iwalulya at openjdk.org
Fri Sep 19 05:10:22 UTC 2025
On Thu, 18 Sep 2025 22:05:59 GMT, Jonas Norlinder <duke at openjdk.org> wrote:
>> 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`
Thanks @JonasNorlinder and @dholmes-ora for pointing this out, I will use `_is_shutting_down` as suggested.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27190#discussion_r2361783277
More information about the hotspot-dev
mailing list