Metronome Garbage Collector behavior on explicit System.gc() calls

If a garbage collection cycle is in progress, the Metronome Garbage Collector completes the cycle in a synchronous way when System.gc() is called. If no garbage collection cycle is in progress, a full synchronous cycle is performed when System.gc() is called. Use System.gc() to clean up the heap in a controlled manner. It is a nondeterministic operation because it performs a complete garbage collection before returning.

Some applications call vendor software that has System.gc() calls where it is not acceptable to create these nondeterministic delays. To disable all System.gc() calls use the -Xdisableexplicitgc option.

The verbose garbage collection output for a System.gc() call has a reason of "system garbage collect" and is likely to have a long duration:

<gc type="synchgc" id="1" timestamp="Oct 20 20:42:27 2008" intervalms="0.055"> 
  <details reason="system garbage collect" /> 
  <duration timems="3.395" /> 
  <refs_cleared soft="0" threshold="31" maxThreshold="32" weak="2" phantom="0" /> 
  <finalization objectsqueued="2" /> 
  <heap freebytesbefore="2303633908" /> 
  <heap freebytesafter="2304483260" /> 
</gc>


© Copyright IBM Corporation 2005, 2010. All Rights Reserved.
© Copyright Sun Microsystems, Inc. 1997, 2007, 901 San Antonio Rd., Palo Alto, CA 94303 USA. All rights reserved.
US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
This information center is powered by Eclipse technology. (http://www.eclipse.org/)