- All Superinterfaces:
- GarbageCollectorMXBean,- MemoryManagerMXBean,- MemoryManagerMXBean,- PlatformManagedObject
GarbageCollectorMXBean is an interface used by the management system to access garbage collector properties and reset the values of associated counter and accumulator properties.
This platform extension is only available to the garbage collection implementation that supports this extension.
- Since:
- 1.5, 18
- 
Method SummaryModifier and TypeMethodDescriptionlongThe number of collections completed by this collector since the last reset byresetCumulativeStats.longThe number of pauses of all types required by this collector during its completed collections since the last reset byresetCumulativeStats.longThe approximate cumulative wall clock time in nanoseconds spent in all types of pauses required by this collector during collections completed by this collector since the last reset byresetCumulativeStats.longThe approximate cumulative wall clock time in nanoseconds spent in collections completed by this collector since the last reset byresetCumulativeStats.longThe number of garbage collection threads in the pool of garbage collection threads for this manager.Returns aGcInfoobject that contains detailed information about the most recently completed garbage collection.longThe time elapsed in nanoseconds between Java virtual machine launch and the most recent reset done byresetCumulativeStats.longThe total number of pauses required by this collector during collections completed by this collector since Java virtual machine launch.longThe total elapsed wall clock time in nanoseconds spent in all types of pauses required by this collector during collections completed by this collector since Java virtual machine launch.longThe total elapsed wall clock time in nanoseconds spent in collections completed by this collector since Java virtual machine launch.longReset to zero the cumulative values returned bygetCumulativeCollectionCount,getCumulativeRunningTimeNanos,getCumulativePauseCount,getCumulativePauseTimeNanos, and return the time when the reset occured in nanoseconds since Java virtual machine launch.Methods declared in interface java.lang.management.GarbageCollectorMXBeangetCollectionCount, getCollectionTimeMethods declared in interface com.sun.management.MemoryManagerMXBeangetVersion, isValidMethods declared in interface java.lang.management.MemoryManagerMXBeangetMemoryPoolNames, getNameMethods declared in interface java.lang.management.PlatformManagedObjectgetObjectName
- 
Method Details- 
getLastGcInfoGcInfo getLastGcInfo()Returns aGcInfoobject that contains detailed information about the most recently completed garbage collection.Collector specific attributes, if any, can be obtained via the CompositeDatainterface.MBeanServer access: The mapped type of GcInfoisCompositeDatawith attributes specified inGcInfo.- Returns:
- a GcInfoobject representing the most recent GC information; ornullif no GC information is available.
 
- 
getRunningTimeNanoslong getRunningTimeNanos()The total elapsed wall clock time in nanoseconds spent in collections completed by this collector since Java virtual machine launch. The value is updated after the first and each subsequent collection completes, and includes wall clock time spent running both concurrently and during required pauses. This method returns-1if elapsed running time is undefined for this collector.This method is a convenience method whose value is equal to the the accumulated wall clock running time required by this collector between all calls to resetCumulativeStats, plus those that have occurred since the last such call. SeegetCumulativeRunningTimeNanos.- Returns:
- the  wall clock time spent in completed collections;
         or -1if running time is undefined.
 
- 
getPauseCountlong getPauseCount()The total number of pauses required by this collector during collections completed by this collector since Java virtual machine launch. The value is updated after the first and each subsequent collection completes. This method returns-1if the pause count is undefined for this collector.- Returns:
- the total number of pauses required by this collector
         during collections run by this collector, or
         -1if the pause count is undefined.
 
- 
getPauseTimeNanoslong getPauseTimeNanos()The total elapsed wall clock time in nanoseconds spent in all types of pauses required by this collector during collections completed by this collector since Java virtual machine launch. The value is updated after the first and each subsequent collection completes. This method returns-1if elapsed pause time is undefined for this collector.This method may return a value more precise than returned by, and is usually functionally equivalent to, the imprecisely specified GarbageCollectorMXBean.getCollectionTime().This method is a convenience method whose value is equal to the the accumulated durations of all pauses required by this collector that have occurred between all calls to resetCumulativeStats, plus those that have occurred since the last such call. SeegetCumulativePauseTimeNanos.- Returns:
- the elapsed pause time in nanoseconds; or -1if pause time is undefined.
 
- 
getCumulativeCollectionCountlong getCumulativeCollectionCount()The number of collections completed by this collector since the last reset byresetCumulativeStats. This method returns-1if cumulative statistics are not supported.- Returns:
- this cumulative number of completed collections; or
         -1if cumulative statistics are not supported.
 
- 
getCumulativeRunningTimeNanoslong getCumulativeRunningTimeNanos()The approximate cumulative wall clock time in nanoseconds spent in collections completed by this collector since the last reset byresetCumulativeStats. The value is updated after the first and each subsequent collection completes, and includes wall clock time spent running both concurrently and during required pauses. This method returns-1if cumulative statistics are not supported.- Returns:
- the cumulative wall clock time spent in completed
         collections; or -1if cumulative statistics are not supported.
 
- 
getCumulativePauseCountlong getCumulativePauseCount()The number of pauses of all types required by this collector during its completed collections since the last reset byresetCumulativeStats. The value is updated after the first and each subsequent collection completes. This method returns-1if cumulative statistics are not supported.- Returns:
- the cumulative number of required pauses during
         completed collections; or -1if cumulative statistics are not supported.
 
- 
getCumulativePauseTimeNanoslong getCumulativePauseTimeNanos()The approximate cumulative wall clock time in nanoseconds spent in all types of pauses required by this collector during collections completed by this collector since the last reset byresetCumulativeStats. The value is updated after the first and each subsequent collection completes, and is always less than or equal to the value returned bygetCumulativeRunningTimeNanos. This method returns-1if cumulative statistics are not supported.If resetCumulativeStatshas not been called since Java virtual machine launch, this method may return a value more precise than returned by, and is usually functionally equivalent to, the imprecisely specifiedGarbageCollectorMXBean.getCollectionTime().- Returns:
- the cumulative wall clock time spent in required pauses
         during completed collections; or -1if cumulative statistics are not supported.
 
- 
resetCumulativeStatslong resetCumulativeStats()Reset to zero the cumulative values returned bygetCumulativeCollectionCount,getCumulativeRunningTimeNanos,getCumulativePauseCount,getCumulativePauseTimeNanos, and return the time when the reset occured in nanoseconds since Java virtual machine launch. This method returns-1if cumulative statistics are not supported.An implicit call to resetCumulativeStatswith return value zero occurs when the Java virtual machine starts.- Returns:
- the time when the reset occured in nanoseconds since Java
         virtual machine launch; -1if cumulative statistics are not supported.
- Throws:
- SecurityException- if a security manager exists and the caller does not have ManagementPermission("control").
 
- 
getLastResetCumulativeStatsTimelong getLastResetCumulativeStatsTime()The time elapsed in nanoseconds between Java virtual machine launch and the most recent reset done byresetCumulativeStats. This method returns-1if cumulative statistics are not supported. This is a convenience method that returns the value returned by the most recent call toresetCumulativeStats.An implicit call to resetCumulativeStatsoccurs when the Java virtual machine starts, so if the value returned by this method is zero, no user call toresetCumulativeStatshas yet occurred.- Returns:
- the elapsed time between Java virtual machine launch and the
         most recent reset; or -1if cumulative statistics are not supported.
 
- 
getGarbageCollectorThreadCountlong getGarbageCollectorThreadCount()The number of garbage collection threads in the pool of garbage collection threads for this manager.- Returns:
- the number of garbage collection threads in the pool of garbage collection threads for this manager.
 
 
-