jmap histo:live different behavior with ZGC

David Tavoularis David.Tavoularis at mycom-osi.com
Mon Jul 5 09:45:27 UTC 2021


Hi,

When using "jmap -histo:live <PID>", the JVM triggers a Garbage Collection  
when G1 (default GC in Java16), but not when using ZGC. Is it an expected  
behavior or a bug ?
Please note that "jcmd <PID> GC.run" correctly triggers a Garbage  
Collection when using ZGC.
Is there a way to measure only live objects with ZGC ?

Additional information from jmap usage about -histo[:live] : Prints a  
histogram of the heap. For each Java class, number of objects, memory size  
in bytes, and fully qualified class names are printed. VM internal class  
names are printed with '*' prefix. If the live suboption is specified,  
only live objects are counted.

Best Regards
-- 
David


More information about the zgc-dev mailing list