Studying garbage collection

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

Garbage collection can only be run if the process is active.  It is available from Package Statistics view, Class Statistics view and, when instance level information is collected, Instance Statistics view. 

To view details about garbage collection, follow these steps.

  1. In the Profiling Monitor view, select the monitor or agent.  Right click, then select Open With > Package Statistics. The Package Statistics view opens.
  2. Ensure 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.
  3. See the results:
  4. Click Run Garbage Collection   and then Refresh Views   .  Notice the changes in the number of active instances and garbage collected, at the package or class level. 


     
  5. If you create a dump of the object references using the Collect Object References button  , the instances at which you collected the object references will be indicated in the GC thread and marked by the numbered generations.
     

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
Analyzing performance and memory usage - overview
 


 
 

>