menu

Thursday, August 16, 2012

Stack and Heap

What is Stack and Heap?

Stack is a memory location where data type variables, reference type memory location and value type data are stored.
Ex. data type variables -> i,y,cls1 etc
reference type memory location -> ref
value type data -> 4,2

 Heap is a memory location where object of reference type data types are stored.
Ex. Object of class class1, see the figure.
CLR always looks for data in stack first, if reference type data type found then jumps to heap.

No comments:

Post a Comment