5.4.2. The Virtual Memory Address SpaceΒΆ

We have already discussed how the logical address are referenced by the program as it runs, but the Memory Management Unit calculates the physical address before loading the address on to bus. With a virtual memory management system, the logical address space becomes a virtual address space that uses the full range of memory addresses for each process (0 to 4 GB for a 32 bit system).

The virtual memory address space for each process is quite sparse. Recall what the contiguous address space for a process looks like. If address space is sparse, then the heap is quite large, which mean that the stack is unlikely to grow into other memory. A large heap leaves plenty of room for dynamically allocated memory and also for the memory addresses of shared libraries (called DLLs in Windows).

../../_images/local_mem_map.png

The stack for each process grows down toward the global memory at the lower addresses. Thus the stack grows into the heap.