Beginning with JDK 6.0, jhat is included with the standard JDK distribution. This tool can be
used for heap analysis; it is an improved version of hat. It starts a Web server on a binary-format heap dump file produced
by one of the heap dump options such as -XX:+HeapDumpOnCtrlBreak or -Xrunhprof:heap=dump,format=b.
The following example shows the use of jhat. The first command generates a binary heap dump file.
The second command executes jhat on the binary
heap profile.
$ java -Xrunhprof:heap=dump,format=b MyApp
$ jhat -port=7002 java.hprof |
The jhat tool sets up an http
server on the specified port. It can then be accessed by bringing
up the default page in a Web browser, for example, http://<hostname.domain>:7002. If you run hat on the same system as the browser, the server can be
accessed by navigating to the URL http://<hostname.domain>:7002.
For more information on jhat, refer to the following webpage:
http://java.sun.com/javase/6/docs/technotes/tools/share/jhat.html