IBM Pattern modeling and Analysis tool for Java

The IBM Pattern modeling and Analysis tool(PMAT) for Java lets analyze the data from garbage collection and in case of problems such as heap exhaustion (In case of OutOfMemory error) it also gives you recommendations. Please note one important point that the GC analysis tool alone cant help you locate the memory leak and fix it. You will have to use IBM Heap analyzer for that.

The PMAT tool is part of IBM Support Assistant 4.1, you can launch it by going to Launch Activities -< Analyze Problems. Then in the Tools Catalog select the IBM Pattern Modeling and Analysis tool and click on launch



It will ask you for the location of native_stderr.log file for your server. Select the file and click on Ok


Once opened it will show you the summary of gc analysis like this



  • File name : Location and file name of verbosegc trace

  • Number of verboseGC cycles : Number of JVM restart

  • Number of Garbage Collections : GC frequency

  • Number of Allocation failures : AF frequency

  • First Garbage Collection : Timestamp of the first GC

  • Last Garbage Collection : Timestamp of the last GC

  • Number of Java heap exhaustion : Number of OutOfMemoryError

  • Maximum AF overhead : Ratio of time spent in AF and time between AFs

  • Number of 100% overhead : Number of AF overhead 100%

  • Maximum size of Large Object Request : The largest object request and timestamp

  • Number of Large Object Requests : Number of object request (>900KB)

  • List of Java heap failure : Timestamp, Requested Java heap size,Type of failure and available Java heap size.



During the first few minutes of executing memory leak servlet. It did not throw OutOfMemory exception so in the recommendation it says that no memory exhaustion but there seems to be increase in java heap size, this can be taken as early warning sign of memory leak in the application.

After few minutes when the memory was exhausted and was started throwing OutOfMemory exception i looked at the gc analysis again in the PMAT tool and this is what i see


As you can see there are three errors related to java heap exhaustion that means the GC not able to free up memory and heap is full. One other thing is that whenever there is OutOfMemory error was would generate heap dump automatically. You can get location of the heapdump file from native_stderr.log file.


You can also look at the graphical memory analysis of the data by right clicking on the File and clicking Graphical view all


It will show you the graph of memory like this


As you can see the memory usage went really up some time after 12:33:35 and the red line shows the memory used and blue line show the heap freed after gc. As you can see red line is at near about 100 % and blue line at 0% that means memory is used and gc cant free up space.The vertical black dotted line where blue and red line terminate shows server restart.

1 comment: