This MXBean interface allows monitoring of the number of garbage collections that have occurred and the approximate time they consumed in milliseconds . The methods return -1 to indicate that the garbage collector does not maintain those statistics. Note that VM implementations commonly have more than one garbage collector and use different collection strategies for new objects and old objects. Note also that this is a subinterface of MemoryManagerMXBean . Figure 10-85. java.lang.management.GarbageCollectorMXBeanpublic interface GarbageCollectorMXBean extends MemoryManagerMXBean { // Public Instance Methods long getCollectionCount ( ); long getCollectionTime ( ); } |