Paging Memory Relocation and Fragmentation Paging CSCE 410/611 Paging Memory Relocation and Fragmentation Paging The Memory-Lookup process in hardware Paging and Internal Fragmentation Paging
Observation: Naïve relocation causes (external) fragmentation. CSCE 410/611 Paging Observation: Naïve relocation causes (external) fragmentation. simple relocation Memory Management Unit limit register relocation register ? < + logical memory physical memory Paging
Solution: Partition memory into equal-size portions. CSCE 410/611 Paging Solution: Partition memory into equal-size portions. Memory Management Unit < + < + < + < + logical memory physical memory Paging
Paging in Hardware CPU page table p d f d p f f logical memory CSCE 410/611 Paging in Hardware Memory Management Unit page number offset CPU logical addr p d phys. addr f d p f f page table logical memory physical memory Paging
Paging Address Resolution: Example CSCE 410/611 Paging Address Resolution: Example Example: PDP-11 (16-bit addresses, page size 8kB => 64kB address space, with 8 pages) Memory Management Unit CPU 000 0000000000000000 0000000000000 011 0000000000000 011 F0 F1 F2 F3 F4 F5 F6 F7 F8 page table ... logical memory physical memory Paging
Paging Address Resolution: Example 2 CSCE 410/611 Paging Address Resolution: Example 2 Example: PDP-11 (16-bit addresses, page size 8kB => 64kB address space, with 8 pages) Memory Management Unit CPU 010 0100000000001111 0000000001111 101 0000000001111 F0 F1 F2 101 F3 F4 F5 F6 F7 F8 page table ... logical memory physical memory Paging
Internal Fragmentation in Paging CSCE 410/611 Internal Fragmentation in Paging page size 4kB 3 * 4096 + 1012 Bytes logical memory 13300 Byte 3084 bytes wasted! physical memory Observation: Last frame may not be completely full. General Rule: Average internal fragmentation per block is typically half frame size. Q: Frames: large or small?! Large frames cause more fragmentation. Small frames cause more overhead (page table size, disk I/O) Paging
Paging: Summary Paging eliminates External Fragmentation CSCE 410/611 Paging: Summary Paging eliminates External Fragmentation The Memory-Lookup process in the MMU Paging allows for large address spaces Paging does not completely eliminate Internal Fragmentation Paging