Studying garbage collection

Prerequisites:
Before being able to analyze profiling data to study garbage collection, ensure that the following step has been completed:

The Java run-time system performs garbage collection automatically. It finds memory that a program is no longer using and frees it.

In the Profiling Tool, garbage collection can only be run if the process is active.  To launch a process, refer to the Launching or attaching to an application topic. Garbage collection is available from Package Statistics view, Class Statistics view as well as the Instance Statistics view when instance level information is collected.

To view details about garbage collection,...

  1. In the Profiling Monitor view, select the monitor or agent.

  2. Right click, then select Open With > Package Statistics. The Package Statistics view opens.

  3. Check that the Live Instances and Collected columns are visible. If they are not, right-click, select Choose Columns., then set these columns to be visible.

  4. View the results in the Packages Statistics view:

  5. In the Profiling Monitor view, select the monitor or agent.

  6. Right click and select Run Garbage Collection 

    Garbage collection icon

  7. In the Package Statistics view, right-click and select Refresh Views. The Package Statistics view is refreshed showing the changes in the number of active instances at the package level.

    Package Statistics view showing the packages that have changed in terms of total instances alive.
     

Related concepts
Overview of the Profiling Tool
Execution flow view and table
Statistical views

Related tasks
Profiling an application
Launching or attaching a Java process
Identifying resource-intensive methods