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

Kevin Walls kevinw at openjdk.org
Tue Sep 30 11:53:23 UTC 2025


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

>> Also, genesis (Universe::genesis()?), is a VM detail that may be unclear.  Do we mean:
>> "
>> Returns the CPU time used by all garbage collection threads.
>> 
>> This includes time for all driver threads, workers, VM operations
>> on the VM thread, and the string deduplication thread (if enabled). 
>> Therefore the value can be non-zero even if no garbage collection cycles have occurred. 
>> 
>> This method returns {@code -1} if the platform does not support this operation, or if called during shutdown.
>> "
>
> I meant genesis in the literal sense i.e. since thread creation not relating to `Universe::genesis`. It may be non-zero since each there may do some initialization work and thus CPU time would be non-zero. However given @AlanBateman comment about being HotSpot VM specific should we avoid talking about these specific details here?

"CPU time used by all garbage collection threads"  or even "Accumulated CPU time..." would seem clear that we mean these threads, in this process.  We can leave genesis out of it, whether it meant start of process or dawn of time. 8-)

Yes, might be better as just, "This may include some startup work and overhead, therefore the value can be non-zero even...".

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

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


More information about the jmx-dev mailing list