読者です 読者をやめる 読者になる 読者になる

Quitada ブログ HAX

Hatena Blog でも Quitada ブログ

Tool to find slow memory leak of java applications - version 0.2

I'm pleased to announce that I've released the version 0.2 of the following my tool to find slow memory leak of java applications.

Tool to find slow memory leak of java applications

 

You can download the jar file of version 0.2 from here(src). You can just execute this as a Java appliction with adding this jar file to CLASSPATH. The usage is similar to UNIX diff command like the following.
-----
java quitada.JavaObjectDiff [java histogram file before memory leak] [java histogram file after memory leak]
-----

 

And also, this release is built as a runnable jar. So you can execute this tool with the following command line.

-----

java -jar JavaObjDiff-v0.2.jar [java histogram file before memory leak] [java histogram file after memory leak]

-----

 

In this release, you can additionally see the following output showing the difference of the bytes of each obejcts and sort them in descending order like the following.

-----

Sorted by objects byte
diff of #instances    diff of #bytes        class name
-----------------    ------------------    ----------
10828            731832            [B
10000            320000            com.gemstone.gemfire.internal.cache.VMThinRegionEntry
1739            301136            <constMethodKlass>
10244            245856            java.util.concurrent.ConcurrentHashMap$HashEntry
5632            210472            [Ljava.util.concurrent.ConcurrentHashMap$HashEntry;
5632            180224            java.util.concurrent.ConcurrentHashMap$Segment
211            179104            <constantPoolKlass>
10000            160000            com.gemstone.gemfire.internal.cache.VMCachedDeserializable
9872            157952            java.lang.Integer
 :
-8            -256            java.util.ResourceBundle$LoaderReference
-8            -320            java.util.ResourceBundle$BundleReference
-8            -384            java.util.ResourceBundle$CacheKey

 :

-----

 

To do this, please simply add --sort:byte option lile the following.

-----

java -jar JavaObjDiff-v0.2.jar --sort:byte [java histogram file before memory leak] [java histogram file after memory leak]

-----

 

For details of new options, please execute the following command with --help options.

-----

java -jar JavaObjDiff-v0.2.jar --help

-----