[gclist] Are finalizers plus garbage collection inherently sinful?

Charles Fiterman cef@geode.geodesic.com
Thu, 7 Mar 1996 09:20:15 -0600


The basic theology of Garbage Collection is that the
collector only removes objects which can have no
further effect on execution. It is always correct
to not delete an object. The null collector can always
be used, provided you don't run out of space. Given
enough space you will never invoke the collector
and collection becomes free.

Finalizers effect execution or they wouldn't exist.

Warning! This does not compute! Danger! Danger!

Objects are deleted when they can have no further
effect wherepon they have effect!

Conservative collectors make the safe assumption that
anything that looks like a pointer is one. It is always
safe not to delete an object. But if it has a finalizer
the program is now buggy because that finalizer was not
called. A good argument for the pricise collection of
some programs.

If you have a long chain of finalizer dependencies
the collector will only kill one per collection cycle.
Since the finalizers are important or they wouldn't be
there the program is now buggy or takes a really long
time to terminate.

Circular finalizer dependencys are buggy even without
the collector.