Today, I have read a blog on CodeProject about Memory management .NET.
URL - Article
It says -
Exiting the method (the fun): Now finally the execution control starts exiting the method. When it passes the end control, it clears all the memory variables which are assigned on stack. In other words all variables which are related to int data type are de-allocated in ‘LIFO’ fashion from the stack.
The big catch – It did not de-allocate the heap memory. This memory will be later de-allocated by the garbage collector.
As per my understanding, Garbage collector only de-allocate the Heap memory. So, who will de-allocate the stack memory?
Please suggest.