Stack is discontinuous, the growth direction is upward, i.e., toward the growth direction of increasing memory addresses; stack is continuous, the growth direction is downwards, i.e. in the direction of growth of the memory address is reduced.

Stack is discontinuous, the growth direction is upward, i.e., toward the growth direction of increasing memory addresses; stack is continuous, the growth direction is downwards, i.e. in the direction of growth of the memory address is reduced.
 
Stack: In Windows, the stack is expanded to the low address data structure is a contiguous area of ​​memory. This means that the maximum capacity of the stack address and stack predetermined system is good, in WINDOWS, the stack size is 2M (some say 1M, in short, it is a compile-time constants determined), if when space applications exceeds the remaining space on the stack you will be prompted to overflow. Therefore, less space obtained from the stack. 
Heap: heap is extended to the high-address data structure is not continuous memory area. This is because the system is a linked list of free memory for storing the address of a discontinuous nature, and the list traversal direction is from low to higher addresses.

Guess you like

Origin www.cnblogs.com/yuanch2019/p/11592266.html