Object Allocation Analysis view

Object allocation analysis enables you to capture the information pertaining to the type, number, and age of objects that have been allocated. If you select the object allocation tracking, all classes loaded by the target JVM are instrumented to produce information about object allocations. The object allocation analysis records both the object creation and garbage collection information to provide information about how many objects of each type are still alive, as well as data on live objects. The object allocation analysis enables you to force a Garbage collection Garbage collection icon on the target application to identify the surviving objects and identify the memory leaks in your application.

To perform a Object Allocation analysis (Heap/Memory) profile of an application:

  1. Follow the steps to launch or attach to a process for profiling.
  2. Under the Profile Settings tab, set any desired filters by clicking on the Edit options.
  3. Select Memory Analysis, click Edit Options and select Track object allocation sites.
  4. The object allocation analysis provides a comprehensive view of the application object analysis with the following information:
    Live instances and Active size This is the size and number of active live objects for the given class.
    Total instances and total size This is the total number of object instances and their sizes including the live objects.
    Average age This is the average age for the tracked live objects of this class. The age of the object is measured as the number of garbage collections that this object has survived. Average age is the sum of ages for all objects divided by the number of objects.
    Allocation details The allocation details provides the information about where the object was allocated, the class, method and line number that made the object allocation.

Garbage Collection

You can force a garbage collection on the application by a click on Garbage collection icon in the profiling navigator. The garbage collection updates the surviving objects in the heap following the garbage collection and the ages for all objects allocated on the JVM heap since the moment Profiler was attached to it.

Identifying application memory leak

The Object allocation analysis view provides the number of surviving generations for a class. If this number is much larger than the rest of the application and is constantly growing then this object is a candidate for memory leak analysis. In the profiling navigator, select the monitor and click on "Run garbage collection" to force a garbage collection event, monitor the age of the object. If the object age continues to grow, then this object is being held and not garbage collected. Navigate to the allocation details view to determine the object allocation site of the leaking object. On the other hand, if this metrics stabilizes and does not grow noticeably thereafter, it's guaranteed that your application does not have any growing memory leaks.

*Supported for Java 1.4 and lower java profiling

Related concepts
Overview of the Profiling Tool
Profiling resources
Object References view*

Related tasks
Profiling an application
Identifying memory leaks