Wednesday, April 7, 2010

Java - Heap Dump

Memory is always an issue for software. Whenever it occurs, you will always find it difficult to track them down. If you are using Java6, you can use the following to as help

1. Include JVM options -XX:+HeapDumpOnOutOfMemoryError

This will create a heap dump whenever a OutOfMemoryException occurs. It will output a .hprof file at your root folder

Then, use jhat .hprof to analyze the heap dump. Jhat will analyze the heap dump file and create a server instance for analysis. Use your browser, http://localhost:7000/ to see heap information such as heap histogram.

2. Include JVM options -XX:+PrintGCDetails

This command will print current GC details on application output. Good to know what is the current status of the GC.

3. JConsole

JConsole is an application that can help you monitor your application real time. You can use JConsole to connect local or remote application for application monitor and analyze.

See the following for more details

No comments:

Post a Comment

Tomcat - removing server info

Below are the steps to remove Tomcat Server Information 1. Make sure Tomcat is not running 2. Navigate to "Tomcat Installation"...