RFR: 8359110: Log accumulated GC and process CPU time upon VM exit [v3]
Thomas Schatzl
tschatzl at openjdk.org
Mon Jun 16 08:34:31 UTC 2025
On Fri, 13 Jun 2025 15:59:05 GMT, Jonas Norlinder <duke at openjdk.org> wrote:
>> Both Parallel and G1 reuse the same gc-worker threads in `safepoint_workers()` for non-gc work, just fyi.
>
> FWIW; I confirmed with @stefank that `_runtime_workers` shoud not be accounted for GC CPU time for ZGC.
But then runtime tasks performed by the GC worker threads when using them for runtime work is differently counted towards those GCs that do this sharing/shadowing.
I looked a bit what they are doing, after JDK-8329488 they are only used by heap inspection and heap dumping. Which seems to be solely GC related task, so I kind of think they should be counted against GC.
At least make the accounting uniform across collectors.
So one option is duplicating these workers in G1/Parallel too, and fix https://bugs.openjdk.org/browse/JDK-8277394. Since we can't share GC workers and these "runtime workers" any more due to this change, the safepoint workers management should probably be moved to `CollectedHeap`, and they shouldn't be advertised as general purpose workers everyone can hook into.
Or just let ZGC's `_runtime_threads` also count towards GC time. After all both of these VM operations are `VM_GC_Operations`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25779#discussion_r2149337356
More information about the hotspot-gc-dev
mailing list