Object resurrection

In object-oriented programming languages with garbage collection, object resurrection occurs when an object becomes reachable (in other words, no longer garbage) during the process of object destruction, as a side effect of a finalizer being executed.

Object resurrection causes a number of problems, particularly that the possibility of object resurrection – even if it does not occur – makes garbage collection significantly more complicated and slower, and is a major reason that finalizers are discouraged. Languages deal with object resurrection in various ways. In rare circumstances, object resurrection is used to implement certain design patterns, notably an object pool,[1] while in other circumstances resurrection is an undesired bug caused by an error in finalizers, and in general resurrection is discouraged.[2]