At this point, you should have a basic understanding of garbage collection and the managed heap, including how the garbage collector reclaims an object’s memory. Fortunately for us, most types only need memory to operate. For example, the
ArrayList types are really just types that manipulate bytes in memory. However, some types require more than just memory to be useful.
System.IO.FileStream type, for example, needs to open a file and save the file’s handle. Then the type’s
Write methods use this handle to manipulate the file. Similarly, the
System.Threading.Mutex type opens a Windows mutex kernel object and saves its handle, using it when the
Mutex’s methods are called.
Any type that ...