1 *java.lang.management.GarbageCollectorMXBean* *GarbageCollectorMXBean* The manag
3 public interface interface GarbageCollectorMXBean
5 implements |java.lang.management.MemoryManagerMXBean|
7 |java.lang.management.GarbageCollectorMXBean_Description|
8 |java.lang.management.GarbageCollectorMXBean_Fields|
9 |java.lang.management.GarbageCollectorMXBean_Constructors|
10 |java.lang.management.GarbageCollectorMXBean_Methods|
12 ================================================================================
14 *java.lang.management.GarbageCollectorMXBean_Methods*
15 |java.lang.management.GarbageCollectorMXBean.getCollectionCount()|Returns the t
16 |java.lang.management.GarbageCollectorMXBean.getCollectionTime()|Returns the ap
18 *java.lang.management.GarbageCollectorMXBean_Description*
20 The management interface for the garbage collection of the Java virtual
21 machine. Garbage collection is the process that the Java virtual machine uses
22 to find and reclaim unreachable objects to free up memory space. A garbage
23 collector is one type of memory
24 manager(|java.lang.management.MemoryManagerMXBean|) .
26 A Java virtual machine may have one or more instances of the implementation
27 class of this interface. An instance implementing this interface is an MXBean
28 that can be obtained by calling the (|java.lang.management.ManagementFactory|)
29 method or from the platform
30 <tt>MBeanServer</tt>(|java.lang.management.ManagementFactory|) method.
32 The ObjectName for uniquely identifying the MXBean for a garbage collector
33 within an MBeanServer is:
34 <tt>java.lang:type=GarbageCollector</tt>(|java.lang.management.ManagementFactory|)
35 ,name=collector's name
37 A platform usually includes additional platform-dependent information specific
38 to a garbage collection algorithm for monitoring.
42 *java.lang.management.GarbageCollectorMXBean.getCollectionCount()*
44 public long getCollectionCount()
46 Returns the total number of collections that have occurred. This method returns
47 -1 if the collection count is undefined for this collector.
51 Returns: the total number of collections that have occurred.
53 *java.lang.management.GarbageCollectorMXBean.getCollectionTime()*
55 public long getCollectionTime()
57 Returns the approximate accumulated collection elapsed time in milliseconds.
58 This method returns -1 if the collection elapsed time is undefined for this
61 The Java virtual machine implementation may use a high resolution timer to
62 measure the elapsed time. This method may return the same value even if the
63 collection count has been incremented if the collection elapsed time is very
68 Returns: the approximate accumulated collection elapsed time in milliseconds.