
How to Analyze WebSphere Java Heap Dump for Troubleshooting


Application troubleshooting is always exciting and challenging. However, if you were not equipped with required tools, then it would be frustrating.
If you are working on WebSphere then most of the time during project phase, you need to spend troubleshooting and tweaking application performance.
Most of the time for performance-related issue, you will work with a developer, and you will be asked to take the heap dump for analysis.
There are various ways to take a heap dump. If you are wondering how to take in WebSphere, then this guide will help you.
Once you have the heap dump, you need to analyze, and unfortunately, you canโt open that in notepad, so you got to use the tools. But donโt worry following tools will help you to read the heap dump file for analysis.
They are all FREE!
IBM HeapAnalyzer
HeapAnalyzer by IBM helps you to find the possible Java heap leak area, and you can download from here.
- Once downloaded the jar file, you can run them like below.
java -Xmx4g -jar ha456.jar
- It will open the Analyzer. To open the heap dump, Go to File >> Option and select the heap dump. Based on file size, it may take few seconds and then give you summary view.
The quickest way to suspect for any leak would be:
- Go to Analysis menu >> Analysis view
If no leak found then, it will display something like this.
So go ahead and try out the various options under โAnalysisโ to get familiar with the tool.
Eclipse Memory Analyzer (MAT)
MAT analyze heap dump with hundreds of millions of objects, and itโs fast. Quickly check the suspected leaks and run excellent graphical reports in a minute.
MAT by default doesnโt support WebSphere generated heap dump, so you need to use the plugins.
You can download the MAT from here and plugins from here. Installation of plugins is simple. Just copy the plugin jar file to MAT plugins folder.
- Once downloaded MAT, you can open by executing
./MemoryAnalyzer
- To analyze heap dump file, Go to File >> Open Heap Dump and select the file
- It will take few seconds and prompt โGetting Started Wizard.โ
You can select whatever you want and click on Finish.ย Ah, it found two leak suspects.
MAT is very powerful and can analyze some metrics.
Ex:
- Top consumers by biggest objects
- Biggest top-level dominator classes
- Biggest top-level dominator packages
- Threads overview
- Heap Dumps overview
If you are using another J2EE application server, then you may use VisualVM to analyze the heap dump.
You may also be interested in learning aboutย Java memory management.
More great readings on WebSphere
-
What is Thread Dump and How to Analyze them?Asad Ali on June 29, 2020
-
IBM WebSphere Application Server Beginner’s GuideChandan Kumar on June 9, 2022
-
How to Monitor IBM WebSphere using Application Manager?Chandan Kumar on June 9, 2022
-
How to Use Nginx with WebSphere Application Server?Chandan Kumar on June 9, 2022
-
How to Create Cluster in IBM WebSphere ND?Chandan Kumar on June 9, 2022
-
Whatโs New in WebSphere MQ 9 ย & Installation GuideChandan Kumar on June 10, 2022
Join Geekflare Newsletter
Every week we shareย trending articlesย andย toolsย in our newsletter. More than 10,000 people enjoy reading, and you will love it too.