November 2002
Intermediate to advanced
560 pages
11h 16m
English
The CLR provides automatic memory management. Essentially, this means that when developers create a value (i.e., an instance of any type), the CLR is responsible for allocating and freeing the memory in which that value is stored. Value types and reference types have their memory allocated and freed via different mechanisms, however.
Value types are normally allocated on the program's stack. Whenever a parameter or a local variable is needed, such as when a method is called, memory for the value is allocated on the stack. This memory remains available until the method returns; the stack is then unwound and the memory is automatically reclaimed. This model of allocating and freeing stack-based ...
Read now
Unlock full access