The Heap
The Heap
Write High Performance C# Code
A crash course in Intermediate Language
A crash course in Intermediate Language
Basic optimizations: the low-hanging fruit
Basic optimizations: the low-hanging fruit
Final words
Final words
Many lectures in this course use memory diagrams to show how objects and variables are laid out on the stack and the heap. This lesson will lay down some groundwork and explain in detail what the heap is for, and how data on the heap is laid out in memory.
After completing this lecture you will have learned which data is stored on the heap and what happens when variables that refer to this data go out of scope. Finally, you will be able to explain what the 'Garbage collection' process does.
If you are already familiar with the internal workings of the heap in the .NET Framework, feel free to skip this lecture.