The Memory Analyzer is Open Source!

The Memory Analyzer is an Open Source Project at Eclipse (http://www.eclipse.org/mat/) licensed under the Eclipse Public License. Check out our blog, the WIKI and the forum. If you find a bug, please file it against Bugzilla.

While the open source version contains all the core features, the SAP Netweaver Extensions provide names for NetWeaver deployment units and information about caches, sessions, etc. The extensions are helpful if you analyze heap dumps from NetWeaver Java Server systems.

What does the Memory Analyzer do?

SAP Memory Analyzer is a fast and feature-rich heap analyzer that helps you easily find big chunks of memory and identify who is keeping these objects alive.

The Memory Analyzer was developed to analyze productive heap dumps with hundreds of millions of objects. Once the heap dump is parsed, you can re-open it instantly, immediately get the retained size of single objects and quickly approximate the retained size of a set of objects. The Analyzer is (relatively) low on resource consumption, so you can analyze multi-GB heap dumps on 32 bit boxes.

Read what our users have to say!

What heap dumps are supported?

SAP Memory Analyzer supports by default HPROF binary heap dumps, a de-facto standard of Sun supported also by other vendors:

Sun, SAP and HP JDK/JVM from version 1.4.2_12 and 5.0_7 and 6.0 upwards

Memory Analyzer can also read memory-related information from IBM system dumps. For the purpose one has to install the IBM DTFJ adapter into the Memory Analyzer. Minimum-required versions are:

IBM JDK 1.4.2 SR12, 5.0 SR8a and 6.0 SR2. Read more here.

On what platforms does the SAP Memory Analyzer run?

The Memory Analyzer is based on Eclipse 3.3 and needs a 1.5 JDK. You can either download the standalone application or unzip the plug-ins to your Eclipse installation. The former is available for all platforms that SWT is available. We greatly appreciate your feedback regarding platforms other than Windows as our scarce resources let us primarily target Windows.

How can I get a heap dump?

Please see here for details.

How can I get an HPROF heap dump?

Are you running an AS Java Weekstone with SAP JVM...

  • Use the ConfigTool to configure the following VM parameters:
    -XX:+HeapDumpOnOutOfMemoryError
    -XX:+HeapDumpOnCtrlBreak
  • In SAP MMC right-click on the AS Java server process and select Dump Stack Trace
  • The heap file is written to the working directory of the server, e.g. /usr/sap/<SID>/J<instance>/j2ee/cluster/server<node>/

...or a plain Java Application?

  • If you are running a SAP JVM, use ~/bin/jvmmon.exe
  • On a Sun or HP VM please see the table below.

All options to get an HPROF dump in detail...

via Java VM parameters (see ConfigTool on how to set those for AS Java installations):

  • -XX:+HeapDumpOnOutOfMemoryError writes heap dump on OutOfMemoryError (recommended)
  • -XX:+HeapDumpOnCtrlBreak writes heap dump together with thread dump on CTRL+BREAK (recommended; use SAP MMC to trigger dumps for AS Java installations)
  • -agentlib:hprof=heap=dump,format=b combines the above two settings (old way; not recommended as the VM frequently dies after CTRL+BREAK with strange errors)

via tools:

  • Sun JMap: jmap.exe -dump:format=b,file=HeapDump.hprof <pid>
  • Sun JConsole: Launch jconsole.exe and invoke operation dumpHeap() on HotSpotDiagnostic MBean
  • SAP JVMMon: Launch jvmmon.exe and call menu for dumping the heap

Heap dump will be written to the working directory.

Vendor / Release

VM Parameter

 

 

Sun Tools

 

SAP Tool

 

On out of memory

On Ctrl+Break

Agent

JMap

JConsole

JVMMon

Sun, HP

 

 

 

 

 

 

1.4.2_12

Yes

Yes

Yes

 

 

 

1.5.0_07

Yes

Yes (Since 1.5.0_15)

Yes

Yes (Only Solaris and Linux)

 

 

1.6.0_00

Yes

 

Yes

Yes

Yes (Not working with AS Java)

 

SAP

 

 

 

 

 

 

Any 1.5.0

Yes

Yes

Yes

Yes (Only Solaris and Linux)

 

Yes

If you run into problems opening a heap dump with the SAP Memory Analyzer (Error message: "Unrecognized heap dump sub-record type"), please let us know. This indicates a corrupt heap dump file. In this case we would like to learn which tool/approach you have chosen to dump the heap.

When HPROF heap dumps are NOT written on OutOfMemoryError?

Heap dumps are not written on OutOfMemoryError for the following reasons:

  • Application creates and throws OutOfMemoryError on its own
  • Another resource like threads per process is exhausted
  • C heap is exhausted

As for the C heap, the best way to see that you won't get a heap dump is if it happens in C code (eArray.cpp in the example below):

# An unexpected error has been detected by SAP Java Virtual Machine:
# java.lang.OutOfMemoryError: requested 2048000 bytes for eArray.cpp:80: GrET*. Out of swap space or heap resource limit exceeded (check with limits or ulimit)?
# Internal Error (\\...\hotspot\src\share\vm\memory\allocation.inline.hpp, 26), pid=6000, tid=468


C heap problems may arise for different reasons, e.g. out of swap space situations, process limits exhaustion or just address space limitations, e.g. heavy fragmentation or just the depletion of it on machines with limited address space like 32 bit machines. The hs_err-file will help you with more information on this type of error. Java heap dumps wouldn't be of any help, anyways.

Also please note that a heap dump is written only on the first OutOfMemoryError. If the application chooses to catch it and continues to run, the next OutOfMemoryError will never cause a heap dump to be written! 

How can I get an IBM system dump?

How to get an IBM system dump to be analyzed with Memory Analyzer + DTFJ Adapter depends on the concrete IBM system / JVM. The following resources should provide the necessary description:

  • SAP Note 1259465 - For NetWeaver 6.40 / 7.0x on AIX
  • SAP Note 1265455 - For NetWeaver 6.40 / 7.0x on pLinux (Linux on Power)
  • SAP Note 1263258 - For NetWeaver 6.40 / 7.0x on xLinux (IBM VM for Linux on x86_64) 
  • SAP Note 1267126 - For NetWeaver 6.40 / 7.0x on IBM i
  • SAP Note 1336952 - For NetWeaver 6.40 / 7.0x on zLinux (Linux on System z)
  • The DTFJ Adapter Help available under the "Help" menu in Memory Analyzer after the DTFJ adapter is installed
  • IBM's Diagnosis documentation

Source From:wiki.sdn.sap.com/wiki/display/Java/Java+Memory+Analysis

此文章由 flyinweb 于 2010-01-18 15:54:25 编辑

本日志由 flyinweb 于 2010-01-18 11:47:22 发表,目前已经被浏览 773 次,评论 0 次;

作者添加了以下标签: Memory AnalyzerMAT

引用通告:http://www.517sou.net/Article/398/Trackback.ashx

评论订阅:http://www.517sou.net/Article/398/Feeds.ashx

评论列表

    暂时没有评论
(必填)
(必填,不会被公开)