Object resurrection
Phenomenon in object-oriented programming / From Wikipedia, the free encyclopedia
Dear Wikiwand AI, let's keep it short by simply answering these key questions:
Can you list the top facts and stats about Object resurrection?
Summarize this article for a 10 year old
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]