The Old New Thing

Everybody thinks about CLR objects the wrong way (well not everybody)

Many people responded to Everybody thinks about garbage collection the wrong way by proposing variations on auto-disposal based on scope: "Any local variable that is IDisposable should dispose itself when it goes out of scope." "You should be able to attach an attribute to a class that says the destructor should be called...

When does an object become available for garbage collection?

As we saw last time, garbage collection is a method for simulating an infinite amount of memory in a finite amount of memory. This simulation is performed by reclaiming memory once the environment can determine that the program wouldn't notice that the memory was reclaimed. There are a variety of mechanism for determining this. In a basic ...