Since the virtual address space is so large in 32 bit machines, can the stack and heap ever meet each other?

0

I think of stack and heap as referring to different sections of a process' virtual memory, where one grows upwards and the other downwards. Physical memory addresses (in the form of pages) are mapped to these virtual addresses. AFAIK, the addressing of the virtual address space is from 0x00000000 to 0xFFFFFFFF, which is humongous. Since the area between the stack and heap is so huge (most likely much larger than the actual physical memory on the computer), I don’t think the stack and heap can ever meet each other. Also, what then limits the amount of heap memory a program can ask from the OS?

process
operating-system
stack-overflow
heap-memory
virtual-address-space
asked on Stack Overflow Apr 24, 2020 by Shashank Kumar • edited Apr 24, 2020 by Remy Lebeau

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0