Saturday April 12, 2008
Utility to compare Class Histograms
We use the Class Histograms generated by -XX:+PrintClassHistogram jvm option quite often to diagnose memory leak issues. But we have to manually compare the histogram entries to analyze the difference between entries and the growth in heap.
I have written a utility in Java that reads the histograms from the file containing these histogram dumps and shows them in a graphical interface. One can click on these histograms and view them in this utility and can also compare any two histograms.
How it works:
- Compile the source java files located here: http://blogs.sun.com/poonam/resource/compare_histograms/src.zip
or just take the compiled jar file from here:
http://blogs.sun.com/poonam/resource/compare_histograms/CompareHistograms.jar
and Launch CompareHistograms class file. This will bring up the main window of the tool.
java CompareHistograms or java -jar CompareHistograms.jar
- Select the file containing histograms File->Open Histogram File. You will see this file in the "Histogram File" text field.
- It will show the histograms present in the file.
- Double click any histogram to view it.
- Select any two entries and click the "Compare Histograms" button to compare histograms.
- The histograms and histogram diffs can be exported to text files using Tools->Export Histogram menu item.
Posted at 04:17PM Apr 12, 2008 by poonam in Sun | Comments[1]
d
Posted by 82.150.18.3 on August 07, 2008 at 05:22 PM IST #