The doc for GarbageCollectorMXBean getCollectionCount says Returns the total number of collections that have occurred, is it from the start of the time of start of JVM?
From what I am seeing it looks like the number of GCs from the last poll on getCollectionCount. Where can I see a sample (maybe G1GC) implementation for GarbageCollectorMXBean?
GarbageCollectorMXBean indeed returns total number of collections that have occurred since the start of the JVM.
What I was looking at was a wrapper over GarbageCollectorMXBean which used to explicitly maintain the lastValue & emit the difference.