Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News IBM and SAP Open Source their JVM Diagnostics Tools

IBM and SAP Open Source their JVM Diagnostics Tools

This item in japanese

IBM recently announced their Java diagnostic tool suite that includes the products Dump Analyzer For Java, Extensible Verbose Toolkit (EVTK) for Garbage Collection (GC), and Java Lock Analyzer (JLA) tools. IBM alphaWorks team worked on these JVM tools and published the details on how to use them in a technical article series called Java diagnostics, IBM style. SAP also made an announcement last month about their heap analyzer tool called SAP Memory Analyzer and the tool's integration with Eclipse IDE.

For java developers who work or forced to work (as it is the case sometimes) on analyzing and interpreting the JVM performance monitoring and diagnostics statistics, there are not too many agile open source tools to download, install, and start the analysis process. It can be frustrating to analyze the JVM logs just by looking at the contents of the log files in text format. This can be a daunting task especially when the team is asked to put off the JVM related "fires" in the production environment where it's critical to analyze the logs and quickly identify the problem areas in the java application. This is even more so with thread dump logs which are more complex to interpret and analyze the data without the help of a visual tool.

Java Dump Analyzer and Garbage Collection Analysis Toolkit work with IBM JVM's and they can be downloaded using IBM Support Assistant (ISA), a free software workbench that can be used to download and work with IBM software products.

Dump Analyzer:

This tool performs basic analysis on an already generated and formatted system dump file. It can be launched from within ISA program or from command line. It's based on IBM's Diagnostic Tooling Framework for Java (DTFJ), an API that is the foundation for building Java diagnostic tools. DTFJ API allows tooling to analyze problems as well as produce report information with the analysis output.

The analysis process using Dump Analyzer starts with creating a DTFJ image based on the data selected by the user. This image represents the entire operating system image with details of runtime parameters, Java threads, and objects in the heap. Then it performs the analysis of this image based on the user selected modules. Once the analysis of all selected modules is completed, Dump Analyzer generates a report (in HTML or ASCII format) with the analysis results.

Dump Analyzer tool is also extensible where the java developers can write their own custom analysis modules by extending the Dump Analyzer API.

Garbage Collection Analysis Toolkit:

The GC toolkit can be used to diagnose the verbose GC logs and analyze memory-related JVM performance problems. If not configured correctly, GC process in the JVM can consume more resources and eventually slow down or even crash the java application. GC toolkit can handle logs from IBM JRE's versions 1.4.2 or higher. It can also be used to analyze the GC logs generated from WebSphere Real Time server.

GC toolkit can analyze a single GC log file or compare multiple files side by side which is useful when comparing GC trends before and after making code changes to address the memory leaks or performance problems in the JVM. Developers can also focus in on specific contents of the GC log by filtering the data. It also provides templates to let java developers save the custom settings for later use.

IBM developerWorks post on GC toolkit explains how to install and launch the tool and open a file for analysis or compare several files at the same time. The post also covers three case studies on diagnosing a memory leak, sizing the JVM memory heap, and estimating throughput of a java application based on the GC logs.

Lock Analyzer:

Lock Analyzer for Java, an IBM alphaWorks project, provides a real-time and dynamic lock monitoring on live java applications. It runs on IBM JVMs (versions 5.0 or above) and performs lock analysis on a java application to provide the details on thread activity, thread lock contention and synchronization problems.

Lock Analyzer architecture consists of two components called JLAagent and JLAGui. The agent provides connection to the Java virtual machine to gather the lock information on the running application. The GUI component, which is a Swing based application, provides the graphical view of the lock analysis statistics. JLAGui connects to JLAagent using MBeans API so the communication between the server and GUI client can be local or it can be between two remote machines.

Memory Analyzer tool from SAP tool can be used to view heap dumps that contain a snapshot of all objects in JVM memory at the point in time when the heap dump was generated. It supports a variety of JVM's from Sun, HP, and SAP (versions JDK 1.4.2, Java SE 5 and 6.0). It's available as a standalone product which based on the Eclipse Rich Client Platform (RCP) or as a Eclipse plug-in so the tool can be launched directly from within Eclipse IDE.

Memory Analyzer provides different views of heap information through "Class Histogram Grouping" which shows a list of all objects in memory along with the object count and memory heap retained (in bytes) by these objects. "Dominator Tree" view can be used to look at the distinct objects (single object or a group of objects of the same class) with largest retained heap that can be freed if these objects would be garbage collected. Other views include "Leak Suspects" which shows those objects that are identified as memory leak suspects and "Paths from GC roots" view shows the garbage collection details for the potential memory leak causing objects and their roots in the GC process. All these views provide good visual cues on which objects in the application are not being cleaned up by GC process.

Other than IBM and SAP, there are other free JVM log viewers that come handy when analyzing and interpreting the JVM server logs. Here is a list of these tools categorized by the type of analysis they support.

Thread Dump Analysis:

In this category, IBM Thread and Monitor Dump Analyzer, Thread Dump Analyzer (TDA), and Lockness are popular thread log analyzers.

IBM Thread Dump Analyzer works with IBM supported JVM's. The author tried to open a thread dump generated in a java application using Sun JVM but the tool didn't recognize the thread dump log format. TDA is an utility program that can be used for offline analysis of thread dump logs. Lockness analyzer is an Eclipse plugin so it can be launched from within the IDE.

Heap snapshot analysis:

IBM Heap Analyzer allows java developers to view the JVM memory information stored in the heap logs. The tool works with Sun JDK but it is not as intuitive as SAP Memory Analyzer in representing the heap details.

HAT is project that can be used to view heap information in the form of series of web pages showing different views of the memory usage details. There are several views of heap information available but it's not easy to trace the heap details between the different views.

HPjTune and HPjMeter are heap analysis tools from HP. When the author tried to open heap logs generated in a java application using Sun JVM (version 1.4.2), HPjTune didn't recognize the log files.

GC log analysis:

In this category, GCViewer is a good tool for viewing already generated GC log files. It supports most of the JVM's out there (Sun, IBM, HP-UX and BEA JRockit). It's pretty straightforward to install and run from a command line. GCViewer shows the visual graphs of garbage collection information about Young and Tenured generation, and Full and Partial GC times. A review on Java Performance Tuning website about GCViewer tool talks about how to tune a typical java application based on the GC logs analyzed using GCViwer.

The later versions of JDK (Java SE 5 or later) offer excellent JVM monitoring and management capabilities right out of the box. But for those java developers who are using earlier versions (JDK 1.4 or lower) the tools covered in this article come handy in analyzing JVM logs. As each of these tools come with different features, the developers should evaluate the tools before deciding on which ones to use in their JVM performance monitoring and fault diagnosis efforts.

Rate this Article