Using IBM HeapAnalyzer to analyze Java heap usage and detect possible Java heap leak
IBM HeapAnalyzer analyzes Java heap dumps
Resolving the problem
What is IBM HeapAnalyzer?
IBM HeapAnalyzer implements a new technology that allows the finding of a possible Java heap leak area through its heuristic search engine and analysis of the Java™ heap dump in Java applications.
How does IBM HeapAnalyzer work?
IBM HeapAnalyzer analyzes Java heap dumps by parsing the Java heap dump, creating directional graphs, transforming them into directional trees, and executing the heuristic search engine. The following are examples of features:
- List of objects/classes/arrays by size
- List of objects/classes/arrays by size of child
- List of objects/classes/arrays by number of child
- List of objects/classes/arrays by frequency
- List of objects/classes/arrays by alphabetical order
- List of available heap spaces by size
- Available heap space distribution chart
- Tree view of Java heap dump
- Locations of possible Java heap leak areas
- Loading/Saving processed Java heap dumps.
What can I find a Java heap leak with in HeapAnalyzer?
The following is a snapshot of IBM HeapAnalyzer. One of the possible memory leak areas is highlighted in the tree view. There are 192 entries of java.util.Hashtable$Entry (44% of total Java heap, Heap size is 258,494,664 bytes, TotalSize of java.util.Hashtable$Entry is 114,724,208 bytes) referenced in the org.apache.xml.utils.XMLReaderManager object which has a memory leak (reported in XSLT4J Java 2.6.2).
The following snapshot shows that HeapAnalyzer located a possible leak area
(com/ibm/ws/webcontainer/srt/CachedTargets) where there is actually no leak, because cache objects behave like leak objects. HeapAnalyzer cannot yet discern between leak objects and cache objects.
What is required to run HeapAnalyzer?
- Operating System: Java 2 Platform, Standard Edition
- Java Tool: Java Run-time Environment 7 or above (IBM Java Run-time Environment 7 or above for IBM Java system dump analysis) Note: 64-bit Java run-time environment is needed for processing heap dumps that require more than 4GB of memory
- Memory: Larger memory than the size of Java heaps
How can I get Java heap dumps?
HeapAnalzyer analyzes heap dumps generated by SDKs 1.3.1, 1.4.x and 5.0 (Microsoft Windows, AIX, Solaris, HP-UX and Linux. To enable heap dump on IBM SDK, set the IBM_HEAPDUMP option. See the IBM JVM Diagnostics Guide for details.
Where can I get a copy of HeapAnalzyer?
HeapAnalyzer is available at IBM developerWorks:
How can I install HeapAnalyzer?
- Download haNNN.jar from the provided link
- Run haNNN.jar with Java Runtime Environment.
More support for:
WebSphere Application Server
Software version: 5.1, 5.1.1, 6.0, 6.0.1, 6.0.2, 6.1, 6.1.1, 7.0
Operating system(s): AIX, HP-UX, Linux, Solaris, Windows
Reference #: 1190608
Modified date: 23 October 2007