tri_inn

tri_inn

  • NA
  • 1.2k
  • 233.8k

How memory is allocated in .Net application

Feb 26 2015 8:54 AM
i like to know in details and want to visualize how memory is allocated in dotnet program. sorry because i will be asking few question. so please answer point wise in detail.
 
1) suppose i have class called employee which has data member called empNo, Name and Salary. so i like to know when we will create object of employee then how memory will be allocated ?
 
2) where memory will be allocated for employee object? in heap or stack?
 
3) why memory is allocated in heap for object and local variable in stack?
 
4) i hear some time memory is allocated in heap for local variable  but when?
 
5) where actual data is stored like employee name or salary in heap or stack? if in stack why? why not in heap?
 
6) i heard that memory is allocated for static class in high frequency heap........what is  high frequency heap and how it is different than normal heap?
 

Answers (4)