Take Out the Trash: Theory of Garbage Collection
Memory management used to be a painful exercise in application development, not to mention a source of security flaws. Applications that have poor memory management continue to consume system resources and eventually bring down the operating system. .NET solves this problem by making use of a generational garbage collector to manage all allocated memory within the application's process. This frees the developer from the tedious task of ensuring that allocated memory is properly release backed to the system.
When an object is created, the garbage collector allocates memory from the existing application memory pool or, if necessary, increases the memory pool to accommodate the ...