
CS 414 : Operating Systems
UNIVERSITY OF VIRGINIA
Department of Computer Science
Fall 2005
Topic 13: Sharing Main Memory -- Paging
Readings for this topic: Ch.8 (8.4 & 8.5)
Paging: goal is to make allocation and swapping easier.
Make all chunks of memory the same size, call them pages. Typical sizes range from
512-8k bytes.
For each process, a page table defines the base address of each of that process’ pages
along with read-only and existence bits.
Translation process: page number always comes directly from the address. Since page
size is a power of two, no comparison or addition is necessary. Just do table lookup and
bit substitution.
Easy to allocate: keep a free list of available pages and grab the first one. Easy to swap
since everything is the same size, which is usually the same size as disk blocks to and
from which pages are swapped.
Problems of paging:
Internal fragmentation: The larger the page, the worse this is.
Efficiency of access: even small page tables are generally too large to load into fast
memory in the relocation box. Instead, page tables are kept in main memory and the re-
location box only has the page table’s base address. It thus takes one overhead reference
for every real memory reference.
Table space: Page tables are big. How big? Consider a 32-bit addresss space with 4k
pages as in Windows NT.
— 13.1 —