Possible Duplicate:
What and where are the stack and heap?
With regard to the basic concepts of memory layout in a c program, I understand the that:
- The language uses two primary data structures stack and heap.
- Stack is created to store the local variables and book keeping data of subroutines
- Heap is created to store the dynamically allocated variables of the program
- Heap is of variable length in nature.(Not very sure on stack)
- Normally it is the responsibility of the compiler/Language to request the OS to create these data structures before the execution.
Questions
- What is the initial size with which a stack/heap is created? and who decides it?
- Wherein physical memory are they are created? I see a general description as "Stack is created in the top-level-address and the heap at the low-level-address" Please elobarate this