Thread CPU times of G1 background threads

Markus Gaisbauer markus.gaisbauer at gmail.com
Wed Jun 3 12:26:47 UTC 2015


Hi,

I am working on a JVMTI agent and currently try to get a good estimate on
the total amount of CPU time consumed by the VM for GC.

I already found out about sun.management:type=HotspotThreading
and InternalThreadCpuTimes. Unfortunately this does not work for G1 which
fails to deliver metrics for the following threads:
* G1 Main Concurrent Mark GC Thread
* G1 Parallel Marking Threads
* G1 Concurrent Refinement Thread

I suspect this has to do with the current implementation of
G1CollectedHeap::gc_threads_do which differs
from G1CollectedHeap::print_gc_threads_on (jstack shows all G1 related
threads).

Is this a bug or somehow difficult to change? Is there a better way to get
CPU times from internal VM threads from native code in my agent? The JVMTI
operation GetAllThreads unfortunately does not return internal threads. I
can think of one possible solution that parses output of thread dumps
(VM_PrintThreads)
to detect native thread IDs of GC related threads and determine thread CPU
time this way.

Thank you for any comments and hints,
Markus Gaisbauer (Dynatrace)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-gc-dev/attachments/20150603/13bad51a/attachment.htm>


More information about the hotspot-gc-dev mailing list