images\purify_sml.gifdeep garbage collection (Java)

A memory profiling feature that forces the Java JVM to immediately identify and deallocate all objects that are eligible for garbage collection. To use this feature, click images\gctool.gif while your Java program is running.

A deep garbage collection is different from a JVM automatic garbage collection in that it has three steps:

1.    Invoke the java.lang.system.gc() method, which:

§  Finds and marks as finalized (ready for deallocation) all unreachable objects that do not have finalize methods.

§  Finds and marks as collected all unreachable objects that have finalize methods, and places them in a queue to be finalized.

§  Deallocates all finalized objects.

2.    Invoke the java.lang.system.runFinalization() method, which finalizes all collected objects and marks them as finalized.

3.    Invoke the java.lang.system.gc() method, which deallocates all objects that were finalized in step 2.

A JVM automatic garbage collection includes only the first of these steps. For automatic garbage collections, collected objects waiting to be finalized will not be deallocated until the next garbage collection.

In the Memory Allocation graph, you can identify a deep garbage collection by pausing the mouse cursor over a garbage collection mark images\javagcmark.gif. For deep garbage collections, the tooltip will show two or more garbage collect counts. For example, "Garbage Collect count: 3 – 5".

Notes:

§      A deep garbage collection is always performed before a snapshot dataset is made.

§      Deep garbage collections are not performed for managed code.

See also garbage collection in the glossary.

(C) Copyright IBM Corporation 1992, 2010.