Mustang's HAT!

with

If you use Heap Analysis Tool (HAT), this is a great news for you. Mustang (Java SE 6) (build 51 onwards) includes HAT in $JDK/bin directory. This is called jhat - Java Heap Analysis Tool. So, you don't need to download HAT separately! JDK will include it as part of standard distribution.

Besides we are adding new features to jhat -- stay tuned! I'll blog more about it when the bits become available...

Comments:

If I have to load several external files in my program, how do I load those file references into jhat? Right now I always get java.io.IOException: Thread 200001 not found for JNI local ref

Posted by Amit Kulkarni on September 17, 2005 at 07:35 AM IST #

Hi Amit Kulkarni: I think you are facing HPROF bug 6296437. This bug is being fixed. I don't understand the first part of your question. (i.e., "load files referenced into jhat"). jhat accepts heap dump file and does not need anything else to parse the same. Also, you can dump heap of your process using jmap utility. Unlike HPROF, jmap does not require any agent to be started with jvm. But, HPROF can get allocation site information for all objects, jmap cannot.

Posted by A. Sundararajan on September 19, 2005 at 02:36 AM IST #

I thought that HAT needs a way to load external files... That is, say I am parsing from n+ files, and loading them into memory... Does HAT need access to the files? I read somewhere that the bug was fixed in Mustang, so I downloaded b51 to try it out... Thanks

Posted by Amit Kulkarni on September 19, 2005 at 04:28 PM IST #

Hi Amit Kulkarni: I believe you are referring to reading multiple heap dump files with jhat. There is the concept of "baseline" dump file that can be used as "reference" dump to compare to another dump file. You can specify baseline dump file using the option -baseline. This is useful if you are comparing two heapdumps and want to analyze how heap changed b/w those dump files. For most use cases, you would just need to use one heap dump file -- if so, that dump file can be specified in jhat command line without using any option.

Posted by A. Sundararajan on September 20, 2005 at 05:18 AM IST #

Hi Sundar, Please look at my post here and forward some comments to the 'javac' team Thanks http://forestlaw.blogspot.com/2005/09/programming-java-advice-for-sun-to-woo.html

Posted by Amit Kulkarni on September 28, 2005 at 04:36 PM IST #

Hi Amit: While I can forward this, I'd suggest you post your javac comments directly to Peter Ahe's blog

I went through your page. I think some your comments are already addressed in recent releases (for example autoboxing/unboxing in certain contexts involving generics, enhanced for-loops and -Xlint option has beed added in JDK 5.0)

Comments about JVM command line options have nothing to do with javac. In JDK 5.0, GC Ergonomics has been improved -- hopefully that should help avoiding guess work.

Posted by A. Sundararajan on September 29, 2005 at 05:20 AM IST #

This is a bit ironic:

I have a heap dump (binary format) which I got by using the <code>-XX:+HeapDumpOnOutOfMemoryError</code> option with Mustang (build 62). When I try to use jhat to analyze the dump file, I get an <code>OutOfMemoryError</code>!

The dump file is approx. 80 MB. I tried running jhat both on a linux box and a Solaris 10 x86 box, both with 1 gig of RAM (although with less than 500 MB free (physical)).

So, is there a way I can increase the max heap size jhat uses?

Here's the stack trace:

$ jhat java_pid1483.hprof
Reading from java_pid1483.hprof...
Dump file created Fri Dec 09 21:40:02 CET 2005
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        at com.sun.tools.hat.internal.parser.HprofReader.appendToInstanceBuf(HprofReader.java:776)
        at com.sun.tools.hat.internal.parser.HprofReader.readInstance(HprofReader.java:799)
        at com.sun.tools.hat.internal.parser.HprofReader.readHeapDump(HprofReader.java:512)
        at com.sun.tools.hat.internal.parser.HprofReader.read(HprofReader.java:224)
        at com.sun.tools.hat.internal.parser.Reader.readFile(Reader.java:91)
        at com.sun.tools.hat.Main.main(Main.java:161)

Posted by John H. Embretsen on December 13, 2005 at 06:50 AM IST #

Never mind, I found the answer in Alan Bateman's blog entry called "Heap dumps are back with a vengeance!": <p /> <code> $ jhat -J-mx512m java_pid1483.hprof </code> <p /> I find all these blogs about Java/Mustang debugging tools very helpful! Thanks!

Posted by John H. Embretsen on December 13, 2005 at 07:49 AM IST #

Trying to jhat a huge file size: 05/26/2006 05:50 AM 273,243,560 snapshot2.hprof C:\\workspace\\software\\jdk1.6\\bin>jhat -J-mx512m snapshot2.hprof Reading from snapshot2.hprof... Dump file created Fri May 26 05:50:07 CDT 2006 Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at com.sun.tools.hat.internal.parser.HprofReader.appendToInstanceBuf(HprofReader.java:776) at com.sun.tools.hat.internal.parser.HprofReader.readInstance(HprofReader.java:790) at com.sun.tools.hat.internal.parser.HprofReader.readHeapDump(HprofReader.java:512) at com.sun.tools.hat.internal.parser.HprofReader.read(HprofReader.java:224) at com.sun.tools.hat.internal.parser.Reader.readFile(Reader.java:91) at com.sun.tools.hat.Main.main(Main.java:148) C:\\workspace\\software\\jdk1.6\\bin>jhat -J-mx1024m snapshot2.hprof Reading from snapshot2.hprof... Dump file created Fri May 26 05:50:07 CDT 2006 # # An unexpected error has been detected by Java Runtime Environment: # # java.lang.OutOfMemoryError: requested 167772160 bytes for GrET in C:\\BUILD_AREA\\jdk6\\hotspot\\src\\share\\vm\\utilities\\growableArray.cpp. Out of swap space? # # Internal Error (414C4C4F434154494F4E0E494E4C494E450E4850500017), pid=3644, tid=3908 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-beta-b59g mixed mode) # An error report file with more information is saved as hs_err_pid3644.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # What can be done in this case ?

Posted by Kumar on May 26, 2006 at 02:42 PM IST #

hi there me also came across the same exception Exception java.lang.OutOfMemoryError: requested 4096000 bytes for GrET\* in D:/BUILD_AREA/jdk1.5.0_09/hotspot\\src\\share\\vm\\utilities\\growableArray.cpp. Out of swap space? am running JRUN 4 in win2000 my heap size for JRUN jvm settings is 128M min and 512 Max .plz help me regarding this issue as well u can mail me to asmdt at yahoo dot com tnx

Posted by tariq on April 11, 2007 at 01:09 AM IST #

Hi Tariq: Are you getting this message from jhat or from your application>

Posted by A. Sundararajan on April 12, 2007 at 06:32 AM IST #

Post a Comment:
Comments are closed for this entry.
About

sundararajan

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
Bookmarks
Links

No bookmarks in folder

Blogroll

No bookmarks in folder

News

No bookmarks in folder