Before you begin, you must complete Exercise 1.1: Importing the required resource.
Your organization has a three-tiered queuing system that is part of a web proxy application. Each tier of the queuing system has its own queue. The testing team has determined that the application has a memory leak, and suspects that it is in the queuing system. As the developer of one of the queues, you have been given the job of determining which tier is responsible for the memory leak.
To perform memory leak analysis, you need to capture two Java heap dumps.
The heap is a block of memory that the Java virtual machine (JVM), when running, uses to store Java objects. Java heap memory is managed by a garbage collector, which automatically deallocates memory for Java objects to which there are no remaining references.
A heap dump is an image of the contents of the heap at a specific moment.
You need two heap dumps so that you can see how memory usage changes between two points in your application's run. A built-in algorithm compares the heaps and identifies objects that stay in memory when they should not. The algorithm analyzes the following indicators to identify potential leaks: Objects that are in memory for the entire time interval between the two heap dumps, an increase in the number of objects of a given class in the second heap, and the number of references to an object.
To capture heap dumps, you must switch to the Profiling and Logging perspective:
For this tutorial, you are going to capture the heap dumps manually. (Alternatively, you could set time intervals for capturing heap dumps automatically, or import existing heap dumps.)
To capture the heap dumps:
to capture your baseline heap dump, the starting point for the heap comparison. Additional profiling resources now appear in the Profiling Monitor view, one for Automatic Leak Detection, and one for the heap dump that you have just captured.
in the Console view to terminate the process.Before you can collect any kind of profiling data, Agent Controller must be running. If you get a message that Agent Controller is not available, make sure that Agent Controller has been installed, start it manually, and try again. For instructions, refer to the installation guide. You can access the installation guide by using the launchpad, or you can find it on the product CD under disk1/install.html.
After you have collected data, you are ready to begin Exercise 1.3: Analyzing leak candidates.