Eclipse Memory Analyzer – Standalone Installation
In this tutorial let’s see how to
- Download and start working on Eclipse Memory Analyzer – Standalone version.
- Open a java heap dump created out of sun/oracle jdk (*.hprof) and a heap dump created out of IBM jdk (*.phd) files.
Step 1:
Search for “eclipse memory analyzer” and download “Windows (x86_64)” version (if the windows machine has 64 bit jdk) from https://eclipse.org/mat/downloads.php
Step 2:
Save file and unzip it.
Step 3:
Launch MemoryAnalyzer.exe
Step 4:
If the default java version is 1.7 or greater, MemoryAnalyzer will start without any issues.
java version “1.7.0_45”
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
Step 5:
Now, we are all set to open a heap dump (*.hprof) generated out of sun/oracle jdk. But before opening lets increase the Max Java heap size argument in “MemoryAnalyzer.ini”. (If needed).
-vmargs
-Xmx1024m
Navigate to File -> Open Heap Dump. Select the hprof file.
Once we select the hprof file, it may take 15-20 minutes depending on the heap dump size and CPU of the local machine, to complete analyzing and open the report as shown below.
To Open a IBM JVM Heap dump – (Portable Heap Dump (phd) format)
IBM heap dumps are generated in *.phd file format. To open *.phd heap dumps, we need to install IBM Diagnostic tool framework for java (dtfj), from the below URL.
http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/runtimes/tools/dtfj/
Step 1:
In Eclipse Memory Analyzer Window, Navigate to Help -> Install New Software and provide the dtfj url and press Enter.
Step 2:
Click Next twice, Accept the terms of the license agreements and then click Finish. IBM diagnostic tool framework will start installing. This may take 5-10 minutes. Once the installation is completed, press “Yes” to restart eclipse.
Step 3:
Once eclipse is restarted, we can now see *.phd files under known formats. To check this, navigate to File -> Open Heap Dump. Select the phd file.
Step 4:
Now the phd file will be loaded and analyzed. This step may take 15-20 minutes depending on the heap dump size.
Errors:
Some general errors we may face during the initial use and solutions for them are provided below.
Error 1:
!ENTRY org.eclipse.birt.chart.device.extension 4 0 2015-11-18 23:24:51.804
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.birt.chart.device.extension [24]
Unresolved requirement: Require-Bundle: org.eclipse.birt.chart.engine; bundle-version=”[2.1.0,5.0.0)”
-> Bundle-SymbolicName: org.eclipse.birt.chart.engine; bundle-version=”4.5.0.v201506092134″; singleton:=”true”
org.eclipse.birt.chart.engine [26]
Unresolved requirement: Require-Bundle: org.eclipse.birt.core; bundle-version=”[2.1.0,5.0.0)”; visibility:=”reexport”
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.birt.chart.device.swt
Unresolved requirement: Require-Capability: osgi.ee; filter:=”(&(osgi.ee=JavaSE)(version=1.7))”
Solution:
The above errors occur when Memory analyser was invoked with java 1.6. They disappear when Java 1.7 is used.
Error 2:
Heap Space.
Sometimes while parsing heap dumps, it fails in-between with the error heap space.
Solution:
In such scenarios, increase the Xmx value in MemoryAnalyzer.ini and try.