Sunday, June 30, 2013

Analyze your IBM thread dump in Linux

Last week I had to analyze a heap dump taken from IBM VM. That heap dump was in .txt file and therefore it is readable. Part from the heap dump is shown below.


NULL           ------------------------------------------------------------------------
0SECTION       TITLE subcomponent dump routine
NULL           ===============================
1TISIGINFO     Dump Event "user" (00004000) received
1TIDATETIME    Date:                 2004/08/23 at 10:20:50
1TIFILENAME    Javacore filename:    /u/mcculls/test/javacore.20040823.102050.16908401.txt
NULL           ------------------------------------------------------------------------
0SECTION       GPINFO subcomponent dump routine
NULL           ================================
2XHOSLEVEL     OS Level         : z/OS 06.00
2XHCPUS        Processors -
3XHCPUARCH       Architecture   : s390x
3XHNUMCPUS       How Many       : 2

As the format of this heap dump is different from hprof file format this cannot be analyzed using either MAT analyzer (the eclipse plugin) or JProfiler because those prefer binary data to analyze.

There is a heap dump analyzer specially to the IBM VM called 'IBM Thread and Monitor Dump Analyzer for Java'. You can download the jar from here. (Please note that this version works with only JDK 7). Then you can simply run the jar file using this command

chanika@chanika-ThinkPad-T530:/apps/jdk1.7.0/bin$ ./java -jar /home/chanika/Downloads/jca445.jar

Then you will get a window as following




Click on File -> Open Thread Dumps -> Brows the thread dump file and select that.

Then that file will come under thread dump list and the when you select the dump file from the list some information in the header will appear as following screenshot




Then you can analyze the thread dump using options in 'Analyze' tab.  This is a sample thread dump analyze I have done.