This chapter examines the C# object and the relation between it and the stack and heap of the memory. The life of the value type stays in the stack, whereas the reference type stays in the heap. I will explain about these using the
windbg.exe program and discuss the different sections of the memory while the CLR executes any .NET application.
Finally, this chapter will discuss boxing and unboxing by examining the stack and heap memory while executing a program.
In .NET, when an application is run, the CLR uses two kinds of memory—stack and heap—to store value types and reference types. ...