Brief introduction
This section is an introduction to the Java Memory Dump diagnostics (MDD4J) troubleshooting tool, which helps you analyze the Java heap to diagnose memory footprint issues. MDD4J's analysis results are provided in the report, which summarizes how the application uses the Java heap.
There are three scenarios that are appropriate to help with mdd4j:
Memory leaks: If the application has java.lang.OutOfMemoryError exceptions, or the detailed garbage collection data shows a gradual increase in memory consumption, mdd4j can point to the data structures that are causing such additions and the components within those data structures.
Excessive memory consumption: If an application does not scale well, or consumes more memory than necessary to implement its required tasks, mdd4j can show you a high-level description of the data structure that consumes too much memory. The MDD4J report shows you how the implementation of the collection and other types of data modeling can cause excessive memory consumption.
Regression testing: MDD4J provides a variety of analysis and data structure views to help you track changes in memory consumption while revising bugs, adding or removing new features.
MDD4J can be obtained through IBM Support Assistant. Because memory heap analysis consumes a large amount of processor and I/O resources, you can also run it outside of the IBM Support Assistant Workbench. Performing memory heap analysis on a server class machine--especially 64-bit machines--allows you to handle an infinite amount of memory heap and reserve a large amount of resources for your workstation, allowing you to perform other tasks.
The mdd4j design goal is to provide enough information to help you identify problems without generating information overload issues. It does not provide an in-depth, low-level expert capability to manually check the entire object graph within the heap. For an in-depth heap dump analysis, you can use IBM monitoring and diagnostic Tools for Java–memory Analyzer.
What is a heap dump?
Heap dumps are also called heap snapshots, which are reference dumps between objects in memory, as well as information about those objects. Heap dumps do not contain information such as variable names, values, or source code.
Before performing heap analysis, a heap dump is required. There are three ways to generate heap dumps:
Automatic: The JVM typically generates a heap dump when content is exhausted and crashes.
Manual: You can send a signal to the JVM asking the JVM to heap dumps. (The MDD4J document has information about how to heap dumps on various platforms).
Programming: IBM SDK for Java contains a Com.ibm.jvm.Dump class. Use its static method to generate a heap dump while your application is running.
How to analyze a heap dump
MDD4J uses different terms for the heap dump file, based on the time it obtains:
Base heap Dumps
Although the JVM generates a heap dump when it crashes, you can compare it to a heap dump that was acquired after the application was started, to learn more about how memory is used. This heap dump, acquired early in the application lifecycle, is called a baseline heap dump and can be used when performing comparative analysis.