Finding a memory leak in a transaction-oriented operation
This procedure may help identify a phase in
your program that creates new objects but does not release them, thus
preventing their removal through garbage collection. For example, your program creates a dialog window
but objects
related to the dialog continue to be held after the window has been closed.
The general procedures consists of the following:
- Profile your application. Collect object references before the
operation in question and view the Object References table. Use the procedure described
in Identifying Memory Leaks.
- Run the operation, collect object references again, and view the table to
see the objects references that were created.
- Terminate the operation, collect object references, and view the table to
see whether any references remain to the created objects.
- To create a dump of the object references, use the Collect Object
References button
.
The objects that existed just prior to the dump are the old objects.
- Then, create a dump of the objects and references just after the
operation is finished. The objects that were created and could not be
collected in the interval between the two dumps of the references will be
labeled as new objects in the Object References table.
- Open the Profiling Monitor view.
- Select the agent.
- Right click, then select Open With > Object References.
The Object References table opens.
To identify an object's references:
- Open the Object References table.
- Ensure that Show Reference By has been selected.
- Select your object class, then expand the item.
- Identify the references that prevent the new objects from being
reclaimed.
Related concepts
Overview of the Profiling Tool
Profiling resources
Object References table
Related tasks
Identifying memory leaks
Profiling an application
Launching or attaching a Java process
Analyzing performance and memory usage - overview
(C) Copyright IBM Corporation 2000, 2003. All Rights Reserved.