X

Sundararajan's Weblog

  • Java
    October 4, 2006

jhat swing interface

Guest Author

Sandip Chitale has created Swing interface to query Java heap dumps.

Java binary heap dumps can be created using

  1. jmap

    jmap -dump:format=b,file=heap.bin <pid-of-java-process>
  2. hprof profiler
  3. From jconsole,
    access hotspot diagnostic MBean.

Recall that jhat (Java Heap Analysis Tool) supports webbrowser based interface.
jhat parses a heap binary file and starts a webserver. Then, we'd use a webbrowser to query the heap. With this new Swing based tool for heap dumps, it is easier to work with heap dumps. I used the following commands to create and view a heap dump using jhat swing interface:


D:\\jdk1.6.0\\demo\\jfc\\Java2D>jmap -dump:format=b,file=heap.bin 1204
Dumping heap to D:\\jdk1.6.0\\demo\\jfc\\Java2D\\heap.bin ...
Heap dump file created
D:\\jdk1.6.0\\demo\\jfc\\Java2D>java -Xmx256m -classpath D:\\jdk1.6.0\\lib\\tools.jar;S
wingJHAT.jar org.netbeans.profiling.tools.SwingJHAT heap.bin
Dump file created Wed Oct 04 19:16:13 GMT+05:30 2006
Resolving 54815 objects...
Chasing references, expect 10 dots..........
Eliminating duplicate references..........

Note: classes in tools.jar may be changed without notice. Not all classes in tools.jar are part of platform interface. Such non-public classes may be renamed or removed in next release!

If you have ideas on improving heap dumps, like different/better file format and/or what needs to be included in heap dumps and so on, then please join and contribute to the heap snapshot project.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.