jmx-dev RFR: 8368527: JMX: Add an MXBeans method to query GC CPU time

Bernd duke at openjdk.org
Tue Sep 30 09:41:26 UTC 2025


On Tue, 30 Sep 2025 08:58:54 GMT, Jonas Norlinder <duke at openjdk.org> wrote:

>> src/java.management/share/classes/java/lang/management/MemoryMXBean.java line 282:
>> 
>>> 280:      *
>>> 281:      * @return the total CPU time for all garbage collection
>>> 282:      * threads in nanoseconds.
>> 
>> Not sure did I miss the discussion, other methods like getTotalCompilationTime() return millis, is it ok or required to use new units here?
>
> It is indeed unfortunate that methods mix units but we are complementing, `OperatingSystemMXBean.getProcessCpuTime()` which returns nanoseconds.

It’s in Both names - especially with the Description - understandable what it means, I was just afraid that people could confuse concepts. Maybe it doesn’t really matter. I think in the gc specific ones the colateral doc was a bit more specific about concurrent times and pauses, in the past.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27537#discussion_r2390586886


More information about the jmx-dev mailing list