Thread Memory Dump Analyzer
In this post I point out two different tools that can be use for Performance analysis as well as Debugging to find problems related to hangs, memory problems or other such problems.
After years of using JAVA and looking at coredumps I still find the task very daunting at times, specially if you are working with a WebSphere Application Server, Liberty or HCL Commerce application. I am not always the point in person to read this, but in the past month I have been exposed to a lot of performance problems. Java cores have always interested me, but I never have had a good tool to open them, and as I grow older, wiser and now with glasses, I need to have tools to help me read this files.
One tool that a colleague shared with me is a must have the IBM Thread Memory Dump Analyzer (TMDA). The TMDA is an IBM java application to analyze java core dumps. Not the heap dumps, there is another tool for that. For heapdumps you can use the Memory Analyzer Tool (MAT) we will talk about that one later.
The requirements to use this tool are:
- Have java installed: you can use use openJDK even on MAC.
- Have a java coredump: generate a core dump using
kill -3 ${PID}
:important: Be aware that to if you are intending to generate a coredump during a load/peak of the JVM, when the system is already burden with work. You want to only generate a java coredump and not a heap dump. The javacore dumps are small files with a snapshot of the current system and are very fast at generating vs heapdumps can be costly if the system is already burden. To ensure that you only generate java thread core dumps, and no heap dumps use:
How to generate only java thread coredumps
Enable the following JVM Parameters:
JVM Setting | Comment |
---|---|
-Xdump:java:events=user |
this one should be set |
-Xdump:heap:events=user |
this one should NOT be present, this is the settings that generates heap dumps |
Generate multiple java thread coredump
It is better to generate more than one java thread dump for that you can use:
kill -3 $PID; sleep 30; kill -3 $PID; sleep 30; kill -3 $PID; sleep 30; kill -3 $PID;
Now it is time to download the tool, TMDA
Download the TMDA
Download link: https://www.ibm.com/support/pages/ibm-thread-and-monitor-dump-analyzer-java-tmda
How to use TMDA
More specific information related to WebSphere Application Server and javacore
https://www.ibm.com/support/pages/mapping-underlying-java-thread-identifiers-those-logging-and-trace
Memory Analzyer tool
This told I have not gotten a chance to use, but I did download it and tried it out. It took a bit of tinkering to get it working in my MAC as a RCP (I had to add the -data to the Info.plist
file to make it work see #anex)
The MAT: https://www.eclipse.org/mat/
EXTRA: Enabling Eclipse RCP to run in a different workspace for MAC
Add the following line as an array after the <key>Eclipse</key>
line:
something like:
<key>Eclipse</key>
<array>
<string>-data</string><string>/Users/angelvera/eclipse-workspaces/mat</string>
Leave a comment