.NET Stack vs Heap
In C#, memory is divided into two regions: stack and heap.
Stack has a fixed size, and the memory is allocated and deallocated in a last-in, first-out manner.
The heap is a more flexible in terms of memory than the stack, but it is also slower…