In this tutorial lets see how to install Memory analyzer in eclipse and start analyzing both Sun/Oracle jdk heap dumps (*.hprof) and ibm jdk heap dumps (*.phd).
In Eclipse, Navigate to Help -> Install New Software.
Enter the eclipse memory analyzer update site url: http://download.eclipse.org/mat/1.5/update-site/ and press enter. Select the necessary components. Here I am selecting only “Memory analyzer for Eclipse IDE” and not selecting “Stand-alone Memory Analyzer.”
Click “Next” twice, accept the terms and conditions, then click “Finish”. Once the installation is complete, we will get the below confirmation message. Press “Yes” to restart eclipse.
Once eclipse comes up, Navigate to “Window->Open Perspective-> Other -> Memory Analysis” to open the memory analysis perspective.
In the file menu, check if the options “Acquire Heap Dump” and “Open Heap Dump” are available. If so, then we are all set for analyzing a hprof heap dump file.
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.
In Eclipse Memory Analyzer Window, Navigate to Help -> Install New Software and provide the dtfj url and press Enter.
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.
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.
Now the phd file will be loaded and analyzed. This step may take 15-20 minutes depending on the heap dump size.