Sunday, April 7, 2013

How to compare two heap dumps and view result using jhat

The jhat is a Java Heap Analysis Tool that comes as a part of the JDK. This tool can be found in the JDK bin directory. For more information on jhat refer to Java SE documentation.













Following is the step to compare two heap files using jhat:

jhat -baseline baseline.hprof newbaseline.hprof

If successful, jhat will start an http server on default 7000 port. To view the result, navigate to
http://localhost:7000/ 


















Classes
Some of the classes you might see
http://localhost:7000/allClassesWithPlatform/
http://localhost:7000/showRoots/
http://localhost:7000/showInstanceCounts/includePlatform/
http://localhost:7000/showInstanceCounts/
http://localhost:7000/histo/
http://localhost:7000/finalizerSummary/
http://localhost:7000/oql/


No comments: