Tactic 4: Tuning the cache size | Solving throughput and response time problems


Tactic 5: Performing the heap dump


+

Search Tips   |   Advanced Search

If all the charts are normal except "Free Space after GC declining," suspect a memory leak. In this situation, IBM recommends performing a heap dump.

There are some tools that can help you perform this analysis. We used IBM HeapDump, a utility shipped with the IBM JDK. It lets you dump all the living objects in the Java heap into a text file called heapdump. This tool analyzes the memory usage of every Java object. This is a step to find which of them are consuming JVM space.

Here is an example of setting up the heapdump in WebSphere Application Server v6.0. To configure IBM_HeapDump, add the name and value pairs in the WebSphere Application Server administrative console.

To do this:

  1. In the administrative console, open...

    Servers | Application Servers | server_name | Java and Process Management | Process Definition | Environment Entries | New

    From there, you can set these name-value pairs. This setting is specific for WebSphere Application Server v6.0. If you do not set the IBM_HEAPDUMPDIR, the default output directory is the root directory of your application server.

  2. Save your modification and restart the application server. Record the JVM PID of your application server process.

  3. At the time when you want to collect a heapdump, you can signal it by running kill -3 JVM_PID.

    This generates files named...

    • heapdump.date.time.pid.txt
    • javacore.date.time.pid.txt

    ...under your IBM_HEAPDUMPDIR. This tool signals multiple heapdump points at the point after a memory leak occurs. This is important to analyze the root cause of the leak.

With the generated heapdump and javacore files, you can analyze what caused this memory leak problem. Various analysis tools exist to help with this investigation. One useful tool is the Memory Dump Diagnostic for Java tool. To acquire download the IBM Support Assistant and perform the following steps...

When the heap dump is available, run the Memory Dump Diagnostic for Java tool:

  1. Start IBM Support Assistant.

  2. In IBM Support Assistant, select the Tools tab.

  3. On the left side, click WebSphere 6.1.

  4. valign=top>On the right side, click Memory Dump Diagnostic for Java.

    The Memory Dump Diagnostic tool displays a list of leak candidates after analyzing the heapdump files. This list contains the suspicious object paths.