Memory Leak Detection on WAS (general directions)

Follow

SIMPLE METHOD:

In the WAS console you can monitor a few things with the PMI (Performance Monitoring Infrastructure). This can tell you basic information about if your memory is being consumed, but not specifics on why. For that, you will need to do a heap analysis (see below).

Setup:

  1. Login to the WAS server console.

  2. Go to Monitoring and Tuning > Performance Monitoring Infrastructure (PMI)

  3. Choose the resource you want to monitor

  4. Each of the statistic sets have different things. I recommend Custom monitoring and choosing the following (click the “Enable” button when you select items to add them to the list):

    • JVM Runtime

      • FreeMemory

      • HeapSize

      • UsedMemory

  1. Optionally you can choose some GC stats as well, completely up to you what you want to view.

  2. Now, at the top, click “Save”.


To To view the stats in “real time”:

  1. Go to Monitoring and Tuning > Performance Monitoring Infrastructure (PMI) > Performance Viewer > Current activity

  2. Choose the resource you wanted to monitor. This will bring up the stats you selected.


HEAP ANALYSIS:

WebSphere Application Server provides a two-stage solution for detection and analysis of memory leaks

  • In the first stage, a lightweight memory leak detection mechanism running within the production WebSphere Application Server uses inexpensive, universally available Java heap usage statistics to monitor memory usage trends, and provides early notification of memory leaks. An automated heap dump generation facility (available in WebSphere Application Server running on IBM JDKs)generates multiple heap dumps that have been coordinated with sufficient memory leakage to facilitate comparative analysis using MDD4J.

  • The second stage the Memory Dump Diagnostic for Java (MDD4J) is used to analyze heap dumps outside the production application server.

We can generate heap dumps in two main ways:

  1. Manually

    • Login to the WAS server console.

    • Click Troubleshooting > Java dumps and cores

    • From there you can choose the resource and click Heap dump.

  1. To enable automated heap dump generation support, perform the following steps in the administrative console:

    • Login to the server.

    • Click Servers > Application servers in the administrative console navigation tree.

    • Click server_name >Performance and Diagnostic Advisor Configuration.

    • Click the Runtime tab.

    • Select the Enable automatic heap dump collection check box.

    • Click OK.

NOTE: The automatic heap dump generation process dynamically reacts to various memory conditions and generates dumps only when it is needed. When the heap memory is too low, the heap dumps cannot be taken or the heap dump generation cannot be complete.

HEAP ANALYSIS TOOLS:

Memory Dump Diagnostic for Java (MDD4J) is an offline heap dump analysis tool.  There are others and when we have time we will examine and list them here.

Have more questions? Submit a request

Comments

Powered by Zendesk