JDK-8368527 : JMX: Add an MXBeans method to query GC CPU time
  • Type: Enhancement
  • Component: core-svc
  • Sub-Component: java.lang.management
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2025-09-24
  • Updated: 2025-10-31
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 26
26Unresolved
Related Reports
CSR :  
Relates :  
Relates :  
Description
The VM supports retrieval of GC CPU time since JDK-8359110. OpenJDK has supported com.sun.management.OperatingSystemMXBean.getProcessCpuTime() since JDK 5. This patch augments the developers toolbox to understand where CPU time is spent.

Introducing this through JMX allows a developer to query process and GC CPU time during critical section and/or after JIT warmup.
Comments
Thanks for implementing this functionality, I think it's great to finally standardize it in the JDK. Just for reference, I want to mention that OpenJ9 has already exposed GC and JIT compiler CPU times since quite some time through their custom com.ibm.lang.management.JvmCpuMonitorMXBean (https://eclipse.dev/openj9/docs/api/jdk11/jdk.management/com/ibm/lang/management/JvmCpuMonitorMXBean.html) MXBean. This functionality is also more or less already exported through the non-standard sun.management.HotspotInternal/HotspotThreading MXBean which is unfortunately not exported any more since JDK 9 (see https://gist.github.com/simonis/f9adae5ab077301dd2d96ac3d885e949 and this discussion on the mailing list: https://mail.openjdk.org/pipermail/core-libs-dev/2023-September/thread.html#111397) and also through the newly added hsperf counters (see JDK-8315149: Add hsperf counters for CPU time of internal GC threads). I welcome this extension wherever you place it and I think once it's done we should add similar functionality for querying JIT compiler CPU time as well.
28-10-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/27537 Date: 2025-09-27 11:18:58 +0000
27-09-2025