Show TOC

Procedure documentationWorking with the Memory Analyzer Locate this document in the navigation structure

 

The Eclipse Memory Analyzer is a fast and feature-rich Java heap analyzer that helps you find memory leaks and reduce memory consumption.

Use the Memory Analyzer to analyze productive heap dumps with hundreds of millions of objects, quickly calculate the retained sizes of objects, find out who is preventing the Garbage Collector from collecting objects, run a report to automatically extract leak suspects.

Open source version

The Memory Analyzer was initially developed at SAP and later contributed to Eclipse. It is available as an open source project at http://www.eclipse.org/mat under the EPL 1.0 license.

Extended SAP version

An extended version of the Memory Analyzer tool is included in the SAP NetWeaver Developer Studio.

This version of the tool provides SAP's specific extensions for memory analysis, including:

  • Display the names for the Application Server Java class loaders, thus revealing to which application, service or library they belong.

  • The extended version of the leak suspect report proposes a CSS component for certain problem suspects.

  • Request specific details are provided in the report, such as the concrete HTTP request processed by a thread, the name of the requested application, and so on.

  • A query displaying all “leaking” class loaders, not properly disposed during stop or redeploy of an application.

  • A query showing all user sessions, their sizes and some of their parameters.

  • A query showing the cache structure.

There are also extensions for performing SAP's specific thread dump analysis and server-side snapshot analysis. For more information, see Performing Thread Dump Analysis and Analyzing Server Snapshots.

More information about the tool can be found on the following web pages:

  • Project page at Eclipse - http://www.eclipse.org/mat/

  • Wiki page on SDN - http://wiki.sdn.sap.com/wiki/display/Java/Java%20Memory%20Analysis

Procedure

Installation

Both features are available under the category SAP NetWeaver Developer Studio Java EE.

Open source version

The open source version of the Memory Analyzer tool can be downloaded from the Eclipse Web site either as a standalone RCP application or as plugins for an Eclipse IDE. For more information, see http://www.eclipse.org/mat/downloads.php.

Extended version

The extended version of the Memory Analyzer tool is included in the SAP NetWeaver Developer Studio. The following two features provide the tool extensions:

  • SAP NetWeaver Developer Studio - Memory Analyzer Extensions for Heap and Thread Dump Analysis

  • SAP NetWeaver Developer Studio - Memory Analyzer Extensions for Server-Side Snapshots Analysis

Getting a heap dump

The Memory Analyzer supports the following heap dump formats:

  • HPROF binary heap dump, available from different JVM vendors, including SAP, Sun, HP.

  • PHD format from IBM JVMs.

  • DTFJ formatted system dumps from IBM JVMs.

You can find a detailed description on how to get a heap dump depending on the on the Wiki page of the tool on SDN: http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=33456.

How to analyze

The Memory Analyzer tool provides a wide range of features for in-depth troubleshooting.

The easiest way to get started if you are faced with an OutOfMemoryError is to get a heap dump, open it with the tool and run the leak suspects report on it.

Running the Leak Suspect Report

The first think the tool asks, when a heap dump is open, is which report to execute. Already at this point you can select the Leak Suspect Report.

Additionally, the Leak Suspect Report can be executed any time by selecting the drop-down menu   Run Expert System Test   Leak Suspects   or Leak Suspects (including NetWeaver) in the toolbar. As a result an HTML report will be opened. It contains an overview of the heap dump and leak suspect info. If the extended SAP's version is used the report could make suggestions about the responsible CSS component, and will contain AS Java specific information.

This report will be stored together with the heap dump (as a ZIP file) and is displayed when you open the heap dump again.

More Information

  • Help within the tool. From the menu path choose   Help   Help Contents   and then look at the Memory Analyzer section.

  • Blog on Finding Memory Leaks with One Click at http://dev.eclipse.org/blogs/memoryanalyzer/2008/05/27/automated-heap-dump-analysis-finding-memory-leaks-with-one-click.

  • Blog at http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/11129.

  • Common Memory Analyzer blog http://dev.eclipse.org/blogs/memoryanalyzer.

  • Eclipse Live! session recording at http://live.eclipse.org/node/520.