IBM®
Skip to main content
    United States change      Terms of use
 
 
Select a scope:    
     Home      Products      Services & industry solutions      Support & downloads      My account     
alphaWorks  >  Java technology  >  

HeapAnalyzer

A graphical tool for discovering possible Java heap leaks.


Date Posted: November 4, 2004
Overview Requirements DownloadFAQsForum Reviews

1. How can I run HeapAnalyzer?
2. How much memory does HeapAnalyzer require?
3. Can HeapAnalyzer process a Java heap dump from Solaris J2SE 1.3.1 and 1.4.x?
4. What do heap dumps look like?
5. What are the common exceptions and errors from HeapAnalyzer?
6. Does HeapAnalyzer Version 1.3.2 support portable heap dump format (.phd), which is available in IBM SDK 1.4.2 SR1?


1. How can I run HeapAnalyzer?

The following is an example of processing a Java™ heap dump of about 1 GB:


<Java Runtime Environment path>java -Xmx1200m -jar ha121.jar

Back to top Back to top

2. How much memory does HeapAnalyzer require?

It depends on the size of each Java heap dump. The size of Java heap dump file is not the size of the Java heap when the Java heap dump was generated.

Back to top Back to top

3. Can HeapAnalyzer process a Java heap dump from Solaris J2SE 1.3.1 and 1.4.x?

Yes, HeapAnalyzer can process Java heap dumps from IBM® SDK 1.3.1 and 1.4.x as well as Solaris J2SE 1.3.1 and 1.4.x.

Back to top Back to top

4. What do heap dumps look like?

The following is an example of text heap dump:


// Version: J2RE 1.3.1 IBM Windows 32 build cn131-20020923
0x50001010 [6000] A
0x50002020
0x50002020 [4000] B
 0x10007030 0x50006040 0x50004050
// EOF: //

Back to top Back to top

5. What are the common exceptions and errors from HeapAnalyzer?

Here are the common exceptions and errors:

Exception in thread "main" java.lang.NoClassDefFoundError: java/util/regex/PatternSyntaxException

HeapAnalyzer requires Java 2 SDK 1.4.1 or above. This exception is thrown if an older version of the SDK is used.


java.lang.StringIndexOutOfBoundsException: String index out of range: 0
	at java.lang.String.charAt(Unknown Source)
	at com.ibm.jinwoo.heap.FileTask$ActualTask.(FileTask.java:386)
	at com.ibm.jinwoo.heap.FileTask$1.construct(FileTask.java:794)
	at com.ibm.jinwoo.heap.SwingWorker$2.run(SwingWorker.java:45)
	at java.lang.Thread.run(Unknown Source)

You can see this exception while processing corrupted heap dumps, truncated heap dumps, or the files that are not supported in text heap dump format. Truncated or corrupted heap dumps are not reliable. Please refer to FAQ #4 for detailed information about the supported format.


Exception while parsing line 9 : 0x0x50003070 [1000] java/lang/String java.lang.RuntimeException
	at com.ibm.jinwoo.heap.FileTask$ActualTask.(FileTask.java:321)
	at com.ibm.jinwoo.heap.FileTask$1.construct(FileTask.java:794)
	at com.ibm.jinwoo.heap.SwingWorker$2.run(SwingWorker.java:45)
	at java.lang.Thread.run(Unknown Source)

Some old Linux IBM SDKs generate invalid address in heap dumps. After replacing 0x0x with 0x, HeapAnalyzer can process heap dumps.


Format error while parsing line 10 : 0x50004050 0x50004050

Unexpected format in heap dump. Possibly it is a corrupted heap dump. Further analysis is unreliable.


java.io.IOException: Not in GZIP format
	at java.util.zip.GZIPInputStream.readHeader(Unknown Source)
	at java.util.zip.GZIPInputStream.(Unknown Source)
	at java.util.zip.GZIPInputStream.(Unknown Source)
	at com.ibm.jinwoo.heap.OpenTask$ActualTask.(OpenTask.java:32)
	at com.ibm.jinwoo.heap.OpenTask$1.construct(OpenTask.java:111)
	at com.ibm.jinwoo.heap.SwingWorker$2.run(SwingWorker.java:45)
	at java.lang.Thread.run(Unknown Source)

You can see this exception when you try to load an invalid .ha (processed HeapAnalyzer file) file.

Back to top Back to top

6. Does HeapAnalyzer Version 1.3.2 support portable heap dump format (.phd), which is available in IBM SDK 1.4.2 SR1?

Yes. HeapAnalyzer 1.3.3 supports the .phd format.


Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.
IBM is a trademark of IBM Corporation in the United States, other countries, or both.
Other company, product, or service names may be trademarks or service marks of others.

Back to top Back to top
View screenshots:
Locating the area of a suspected heap leak.

Download now Download now

Related technologies

For platform(s):
Windows, Linux, UNIX

For topics:
analysis, garbage collection, Java technology, performance, utilities


 

    About IBM Privacy Contact