GarbageCollectorMXBean.java revision 0
0N/A * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. Sun designates this 0N/A * particular file as subject to the "Classpath" exception as provided 0N/A * by Sun in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A * have any questions. 0N/A * The management interface for the garbage collection of 0N/A * the Java virtual machine. Garbage collection is the process 0N/A * that the Java virtual machine uses to find and reclaim unreachable 0N/A * objects to free up memory space. A garbage collector is one type of 0N/A * {@link MemoryManagerMXBean memory manager}. 0N/A * <p> A Java virtual machine may have one or more instances of 0N/A * the implementation class of this interface. 0N/A * An instance implementing this interface is 0N/A * that can be obtained by calling 0N/A * the {@link ManagementFactory#getGarbageCollectorMXBeans} method or 0N/A * from the {@link ManagementFactory#getPlatformMBeanServer 0N/A * platform <tt>MBeanServer</tt>} method. 0N/A * <p>The <tt>ObjectName</tt> for uniquely identifying the MXBean for 0N/A * a garbage collector within an MBeanServer is: 0N/A * {@link ManagementFactory#GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE 0N/A * <tt>java.lang:type=GarbageCollector</tt>}<tt>,name=</tt><i>collector's name</i> 0N/A * A platform usually includes additional platform-dependent information 0N/A * specific to a garbage collection algorithm for monitoring. 0N/A * JMX Specification.</a> 0N/A * Ways to Access MXBeans</a> 0N/A * @author Mandy Chung 0N/A * Returns the total number of collections that have occurred. 0N/A * This method returns <tt>-1</tt> if the collection count is undefined for 0N/A * @return the total number of collections that have occurred. 0N/A * Returns the approximate accumulated collection elapsed time 0N/A * in milliseconds. This method returns <tt>-1</tt> if the collection 0N/A * elapsed time is undefined for this collector. 0N/A * The Java virtual machine implementation may use a high resolution 0N/A * timer to measure the elapsed time. This method may return the 0N/A * same value even if the collection count has been incremented 0N/A * if the collection elapsed time is very short. 0N/A * @return the approximate accumulated collection elapsed time