Memory management was introduced in this chapter. Concepts such as root objects, reference trees, generations, and finalization queues were reviewed. The next chapter expands the conversation to include the disposable pattern, weak references, unsafe pointers, and other topics related to memory management.
Understanding the managed paradigm to memory management is particularly important to C- and Cbased programmers. C programmers are accustomed to managing their own memory with minimal assistance from the environment. For them, memory management in .NET represents a different mindset, which includes adopting new best practices for allocating, managing, and releasing memory. Some C developers perceive the managed memory model as confining, when actually it is liberating.
Although the CLR provides memory management, developers have some sway in the process, which includes pinned pointer, memory stress, forcing garbage collection, and allocation patterns. These topics are introduced in the next chapter.