Internal fragmentation

In paging, we have to allocate exactly a page each time, so we can’t give a program a fractional page to provide just enough but instead we have to give it an entire page.

This causes internal fragmentation.

Paging cannot suffer from external fragmentation: processes do not have to be stored contiguously. Segmentation cannot suffer from internal fragmentation: processes can be allocated the exact amount of memory that they require.

Systems can use a mix of paging and segmentation in an attempt to get the best of both worlds.

  • Virtual addresses are divided into segments of variable length.
  • Segments and main memory are divided into fixed-size pages.
  • Each segment as its own page table, so every process has multiple page tables.