Monitoring the Java heap

The most straightforward, and often most useful, way of monitoring the Java™ heap is by seeing what garbage collection is doing.

Start verbose tracing of garbage collection by using the command-line option -verbose:gc. The option causes a report to be written to stderr each time garbage collection occurs. You can also direct this output to a log file using:
-Xverbosegclog:[DIR_PATH][FILE_NAME]
where:
[DIR_PATH]		 is the directory where the file should be written 
[FILE_NAME]		 is the name of the file to write the logging to

See Garbage Collector diagnostics for more information about verbose GC output and monitoring.



© 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/)