RFR: 8359110: Log accumulated GC and process CPU time upon VM exit [v3]
Jonas Norlinder
duke at openjdk.org
Fri Jun 13 12:54:34 UTC 2025
On Fri, 13 Jun 2025 10:04:18 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
>> Jonas Norlinder has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - Refactor shared logic into CollectedHeap, remove nominal logging and cost->usage
>> - Remove unnecessary assert
>
> src/hotspot/share/gc/z/zCollectedHeap.cpp line 123:
>
>> 121: Atomic::add(&_vtime, os::thread_cpu_time(thread));
>> 122: }
>> 123: }
>
> Why does this exclude threads like the `ZDirector` and other ZGC background threads? That thread seems to clearly be relevant to ZGC operation, doing so would make the measurement incomplete.
> The change does not exclude e.g. some random G1 "director" threads either, even if they do not contribute much to the result.
I believe it does not exclude ZDirector, etc. Adding `printf("%s\n", thread->name());` to prove my point results in:
ZDirector
ZDriverMajor
ZDriverMinor
ZStat
ZUncommitter#0
ZWorkerYoung#0
ZWorkerYoung#1
ZWorkerYoung#2
ZWorkerYoung#3
ZWorkerOld#0
ZWorkerOld#1
ZWorkerOld#2
ZWorkerOld#3
This code is working around the fact that `ZCollectedHeap::gc_threads_do` also calls `_runtime_workers.threads_do` which I believe do not participate in GC related work.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25779#discussion_r2145029576
More information about the hotspot-runtime-dev
mailing list