IBM User Guide for Java V7 on Windows > IBM SDK for Java > The collector and the allocator > How to coexist with the Garbage Collector > Finalizers
Finalizers and garbage collection
The behavior of the Garbage Collector (GC) affects the interaction between the GC and finalizers.
The way finalizers work, described in list item 7 in Garbage collection summary, indicates the non-predictable behavior of the GC. The significant results are:
- The graph of objects that the GC finds cannot be reliably predicted by your application. Therefore, the sequence in which finalized objects are located has no relationship to either
- the sequence in which the finalized objects are created
- the sequence in which the finalized objects become garbage.
The sequence in which finalizers are run cannot be predicted by your application.
- The GC does not know what is in a finalizer, or how many finalizers exist. Therefore, the GC tries to satisfy an allocation without processing finalizers. If a garbage collection cycle cannot produce enough normal garbage, it might decide to process finalized objects. Therefore, it is not possible to predict when a finalizer is run.
- Because a finalized object might be garbage that is retained, a finalizer might not run at all.
Parent: Finalizers
Error 404 - Not Found Error 404 - Not Found
The document you are looking for may have been removed or re-named. Please contact the web site owner for further assistance.