A memory page is a fixed-size chunk of virtual memory that the CPU and operating system map independently to physical memory or storage. Pages are typically 4 KiB, though 2 MiB and other sizes are possible. This granularity lets an application see a contiguous virtual address space even when its physical pages are scattered. section 7.4.3 section 7.4.4
A page’s physical backing and access cost can change during execution:
- The page table records how a virtual page maps to a physical page; adjacent virtual pages need not occupy adjacent physical locations. section 7.4.4
- With demand paging, the operating system can leave a virtual page unmapped until its first access causes a page fault and physical allocation. section 7.4.4
- Under memory pressure, the operating system can move a page to disk and later read it back, changing access from memory speed to disk speed. section 7.4.3 section 7.4.4
Figure 7.4 A process’s virtual memory address space consists of sections that serve different purposes. The text, data, and BSS sections are initialized at program startup, whereas the heap, memory-mapped region, and stack sections change dynamically at runtime (denoted with dotted lines).
Use the process address-space diagram to locate pages within text, data, BSS, heap, memory-mapped, and stack regions, and distinguish startup-fixed from dynamically changing regions. section 7.4.3
Figure 7.5 A page table is a data structure the CPU uses to translate virtual memory addresses to physical addresses. A page in virtual memory does not always have a counterpart in physical memory. Instead, the OS can store a page on the disk, for example, and lazily move it to physical memory when it’s accessed.
Use the page-table diagram to trace virtual addresses to physical memory or disk and visualize lazy movement into physical memory. section 7.4.4

