ABSTRACT

Finalization and weak references are two tricky topics to many Java and virtual machine (VM) developers. ey are closely related to the memory management and threading interactions.

12.1 FINALIZATION Java requires to execute the finalize() method of any object that overrides the default method in java.lang.Object, aer it becomes unreachable and before it is reclaimed. e idea is to provide the application developers a chance to do some wrap-ups when they know the objects become unreachable. e logics in VM to support nalization are like the following.