May 2010
Intermediate to advanced
1272 pages
61h 18m
English
Chapter 4, “Data Types and Expressions,” discusses value types and reference types, describing how both of them are allocated in memory: Value types reside in the stack whereas reference types are allocated on the managed heap. When you create a new instance of a reference type, via the New keyword, the .NET Framework reserves some memory in the managed heap for the new object instance. Understanding memory allocation is fundamental, but an important practice is to also release objects and resources when they are unused or unnecessary. This returns free memory and provides better performances. For value types the problem is of easy resolution: Being allocated on the stack, they are simply removed from memory ...
Read now
Unlock full access