What is the difference between stack and heap in MVC?
1 Answer
0
Difference between stack and heap in MVC
Stack
Stack is responsible for static memory allocation and it allocates the memory at compile time.
It also follows the rules of LIFO (Last in First Out).
In the stack, size limitation is varied according to the operating system.
We can easily access the variables that are allocated on the stack and it takes less time.
Heap
Heap is used for dynamic memory allocation and it allocates the memory at run time.
In a heap, memory is allocated randomly.
There is no limitation of size in a heap.
In heap you can allocate or de-allocate the block any times as per user requirement.
Accessing of the object is so difficult in comparison of stack and takes much more time
Write Your Answer
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.