Java Memory Leak Analysis Tool: Step-by-step procedure to install Eclipse Memory Analyzer

I have been dealing with OutOfMemory Errors on SAP J2EE applications and have used a few tools to analyze the reasons for JVM crash. I have finally settled at using Eclipse Memory Analyzer Tool. A step-by-step tutorial to install Eclipse Memory Analyzer Tool was published earlier. The menu options have changed slightly on MAT 1.3 (the latest version available to-date). Here are the instructions for MAT 1.3:

Download required files to install Memory Analyzer

  1. Download Memory Analyzer from http://www.eclipse.org/mat/downloads.php
  2. If you are analyzing heap dump generated by SAP NetWeaver J2EE, download the Memory Analyzer Extension Pack zipped update site from https://www.sdn.sap.com/irj/scn/index?rid=/webcontent/uuid/c065b342-285c-2d10-559b-dffbb1aa5904 (requires access to SCN which is free). This update site contains information about SAP deployment locations. This file is not required if you are not analyzing an SAP application.
  3. If analyzing .phd files, download IBM's Diagnostic Tool Framework for Java zipped update site from ftp://ftp.software.ibm.com/software/java/support/tools/dtfj/dtfj-updatesite.zip This file is not required if you are analyzing .hprof files.
Eclipse Memory Analyzer File Download

Extract and configure MAT

Decompress the zip file downloaded from eclipse.org (MemoryAnalyzer-1.3.0.20130517-win32.win32.x86.zip is the latest one available) and edit MemoryAnalyzer.ini to adjust -Xmx parameter.

Change it to a value suitable to the free memory available on the computer. This value will be the maximum heap size used by MAT.

MemoryAnalyzer.ini file

If you are NOT analyzing heap dump generated by SAP application or any application running on IBM JVM, you can stop here and start using the MAT by running MemoryAnalyzer.exe

Eclipse Memory Analyzer Tool

Add SAP Memory Analyzer extension

The SAP provided extension provides information on what the classes and methods are referring to in terms of SAP application. This SAP specific application knowledge helps in quickly concluding the reason for OOM error.

Select Help > Install New Software to add the new plugins

Help > Install New Software

Click on Add to specify the archive site (zip file containing the extension)

Add offline update site to MAT

Select the zip file by clicking on Archive

Add offline update site to MAT

Click on Select All to choose the new update site (If you do not see anything under Name, deselect Group Items by Category)

Select ALL to add offline update site to MAT

Review the installation

Extending MAT with SAP specific application knowledge

Read the license and accept the terms if you agree to the usage terms (you can't proceed without accepting the license)

SAP evaluation license agreement

Accept warning

Unsigned archive site

Restart MAT

Restart MAT after installing extension pack

If you are NOT analyzing heap dump generated by an application running on IBM JVM, you can stop here and start using the MAT, else continue with installation of IBM DTFJ extension

Add IBM DTFJ extension

Follow the same steps as above, but choose the IBM DTFJ zip file this time to install the required extension.

IBM DTFJ extension on MAT

IBM Diagnostic Tool Framework for Java on MAT

Review to check if you have chosen correct extension

License text for DTFJ

Restart Eclipse MAT after installing extension

That's it! The tool is now ready to help you.

Leak suspect report - Eclipse Memory Analyzer Tool

Please consider sharing this post on facebook, twitter, linkedin or googleplus

Comments

Popular posts from this blog

OS/DB Migration - CMD. STR, TOC, EXT, R3load, DDLDBS.TPL and more

Fixing Inconsistent Table - Table activation fails due to inconsistency between DD and DB

301 Redirect Using SAP Web Dispatcher