Chapter 7. Managed Memory Model

The first rule of management is delegation. Don’t try and do everything yourself, because you can’t.

Anthea Turner

In managed code, garbage collection is delegated to the Common Language Runtime (CLR). The Garbage Collector (GC) is a component of the CLR and responsible for managing managed memory. This chapter is a practical discussion of the Garbage Collector and the memory mode of the .NET Framework. In managed code, memory is allocated on demand for dynamic objects with the new operator. However, the Garbage Collector is responsible for freeing the memory for that object when necessary. There is no delete operator as in the C++ language.

In C++, the developer was responsible for managing dynamic memory. Dynamic ...

Get Solid Code: Optimizing the Software Development Life Cycle now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.