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

The Java service team recommends that applications avoid the use of finalizers if possible. The JVM specification states that finalizers are for emergency clear-up of, for example, hardware resources. The service team recommends that you use finalizers for this purpose only. Do not use them to clean up Java software resources or for closedown processing of transactions.

The reasons for this recommendation are partly because of the nature of finalizers and the permanent linkage to garbage collection, and partly because of the way garbage collection works as described in Garbage collection summary.


See

  1. Nature of finalizers
  2. Finalizers and garbage collection
  3. How finalizers are run
  4. Summary and alternative approach


Parent: How to coexist with the Garbage Collector


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.