[jdk26u] Integrated: 8373625: CPUTimeCounters creates a total counter for unsupported GCs
jyma22
duke at openjdk.org
Fri Dec 26 23:11:59 UTC 2025
On Mon, 22 Dec 2025 21:23:15 GMT, jyma22 <duke at openjdk.org> wrote:
> `CPUTimeCounters` unconditionally creates `CPUTimeGroups::CPUTimeType::gc_total`. Since only Parallel and G1 are supported by this framework/class, this leads to publishing a counter that always resolves to 0. This may be contradictory for an end-user especially so as we now support logging GC CPU time for any GC inside Hotspot. For an example using `-XX:+UseZGC -Xlog:cpu` we get
>
> [7.907s][info][cpu] === CPU time Statistics =============================================================
> [7.907s][info][cpu] CPUs
> [7.907s][info][cpu] s % utilized
> [7.907s][info][cpu] Process
> [7.907s][info][cpu] Total 186.9562 100.00 23.6
> [7.907s][info][cpu] Garbage Collection 0.6700 0.36 0.1
> [7.907s][info][cpu] GC Threads 0.6692 0.36 0.1
> [7.907s][info][cpu] VM Thread 0.0008 0.00 0.0
> [7.907s][info][cpu] =====================================================================================
>
> But `jcmd $(pgrep -n java) PerfCounter.print | grep -E "sun.threads.total_gc_cpu_time"` prints: `sun.threads.total_gc_cpu_time=0`.
>
> Testing: passed tier1-4
This pull request has now been integrated.
Changeset: 4d138120
Author: Jonas Norlinder <jnorlinder at openjdk.org>
Committer: Paul Hohensee <phh at openjdk.org>
URL: https://git.openjdk.org/jdk26u/commit/4d1381209b94825395102efe7036b9b25ef369f5
Stats: 4 lines in 1 file changed: 3 ins; 0 del; 1 mod
8373625: CPUTimeCounters creates a total counter for unsupported GCs
Backport-of: 30be94086aad42b99a15a05fe5115f552e8efb8b
-------------
PR: https://git.openjdk.org/jdk26u/pull/5
More information about the jdk-updates-dev
mailing list