Class: sun.management.GarbageCollectorImpl
- class GarbageCollectorImpl
- extends MemoryManagerImpl
- implements GarbageCollectorMXBean
Implementation class for the garbage collector.
Standard and committed hotspot-specific metrics if any.
ManagementFactory.getGarbageCollectorMXBeans() returns a list
of instances of this class.
Inheritance
Superclass tree:- java.lang.Object
- sun.management.MemoryManagerImpl
- sun.management.GarbageCollectorImpl
Methods
-
GarbageCollectorImpltop
GarbageCollectorImpl(String name) -
getAllPoolNamestop
synchronized String[] getAllPoolNames() -
getCollectionCounttop
public native long getCollectionCount()Returns the total number of collections that have occurred. This method returns -1 if the collection count is undefined for this collector.- Specified by:
- getCollectionCount from GarbageCollectorMXBean
-
getCollectionTimetop
public native long getCollectionTime()Returns the approximate accumulated collection elapsed time in milliseconds. This method returns -1 if the collection elapsed time is undefined for this collector.The Java virtual machine implementation may use a high resolution timer to measure the elapsed time. This method may return the same value even if the collection count has been incremented if the collection elapsed time is very short.
- Specified by:
- getCollectionTime from GarbageCollectorMXBean
-
getLastGcInfotop
public GcInfo getLastGcInfo()Returns the GC information about the most recent GC. This method returns a com.sun.management.GcInfo. If no GC information is available, null is returned. The collector-specific attributes, if any, can be obtained via the CompositeData interface.MBeanServer access: The mapped type of GcInfo is CompositeData with attributes specified in GcInfo.
- Specified by:
- getLastGcInfo from GarbageCollectorMXBean
Fields
-
gcInfoBuilder
private GcInfoBuilder gcInfoBuilder -
poolNames
private String[] poolNames
