Analyzing memory leaks in distributed applications

You can detect memory management problems at the class and object level by collecting heap information in heap dumps as your application runs, and then comparing the heap dumps. This comparison identifies changes in the memory that is allocated in the Java™ heap, and is the basis for generating a list of the most probable leak candidates.

The following steps are involved in analyzing memory leaks:

  1. Obtain heap dumps for memory leak analysis. Begin leak analysis by capturing heap dumps during a profiling run. How you do this depends on your scenario:
    • If you are analyzing an application running in a development or test environment, you can collect heap dumps directly from the application as it runs on a server with a data collection agent on it. You can capture the heap dumps manually, or at timed intervals. See Obtaining heap dumps for memory leak analysis for information on these two methods of collecting live data.

      Note: When creating the profiling configuration, select J2EE Application as the new configuration type. See Creating a profiling configuration for run-time problem determination for complete instructions.  

    • To analyze an application deployed in a production environment, have the application administrator send you heap dumps gathered using Tivoli® system management tools or the heap dump mechanism of their choice. These may be captured from the TMTP user interface, if supported, or by performing a kill -3 command on the JVM process. This is supported by most platforms and JVMs. If it is not supported on yours, consult the JVM documentation on how to produce a heap dump. See Importing heap dumps for memory leak analysis for complete instructions on importing the heap dump data for analysis.
  2. Generate a list of leak candidates. You can automatically generate a list of leak candidates based on two heap dumps.
  3. Identify memory leaks. The memory leak analysis views identify the objects that are likely to be leaked memory. This information allows you to correct your code and fix the leak.
  4. Optional: Save leak analysis data. You can export a list of leak candidates to HTML files. You can also save all leak analysis data, including heap dumps, in files for use in Profiling and Logging views.
Terms of use | Feedback
(C) Copyright IBM Corporation 2005. All Rights Reserved.