12 VirtualMemory
12 VirtualMemory
Heap 0x00000
malloc(0x20000)
Heap 0x00000
malloc(0x20000)
Heap 0x00000
Heap 0x00000
Heap 0x00000
Heap 0x00000
Heap 0x00000
Heap 0x00000
Heap 0x00000
Heap 0x00000
Mapping
mapping Virtual-to-physicaladdress space Virtual --> virtual
physical addresses.
Stack
We need to keep track of this mapping Heap 0 Virtual Address Space 0 Physical Address Space
Virtual-to-physical map
1MPages Each entry is 4 bytes (a 32 bit physical address) 4MB of map bit address 6416 exabytes of space address space virtual 4PetaPagesbytes is Entry of 8 64PB map
10
The OS allocates stuff all over the place. For security, convenience, or caching optimizations For instance: The stack is at the top of memory. The heap is at the bottom
11
12
p1
p2
offset
offset
(Processor Register)
Address translation has to happen for every memory access it squarely on the critical This potentially puts(which are already slow) for memory operation
14
We could walk the page table on every memory access load or store requires Result: everywalk the page table. an additional 3-4 loads to Unacceptable performance hit.
15