Performance Issues Regarding Finalization

The GC, although it makes life easier for programmers, requires that programmers follow certain guidelines with regard to finalizers.

When an object has a finalizer, it is kept in a global list called the finalization list. The GC uses the list to determine which objects need to have their Finalize() method called during garbage collection. During an initial run of the GC on generation 0, the GC will enumerate through the finalization list to determine if any unreferenced objects can be released. If so, a reference to them is placed into the Freachable Queue and the reference in the Finalization List is removed. The Freachable Queue (pronounced “F-reachable” and meaning finalize-reachable) is a separate ...

Get Delphi for .NET Developer’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.