liveBook · Manning

Memory page

As explained in Rust in Action: Systems programming concepts and techniques

A page is a fixed-size block of virtual memory that is mapped as a unit to physical memory or secondary storage.

A memory page is a fixed-size block used to organize memory. Pages are typically 4 KB on 64-bit operating systems. A program works with virtual addresses, while the operating system and CPU translate those addresses to locations in physical memory. section 6.4.1 section 6.4.3

Grouping virtual addresses into pages means the system does not need a separate translation mapping for every variable. Uniform page sizes also help avoid fragmentation: pockets of free RAM that cannot be put to use. section 6.4.3

Pages matter when memory is accessed:

  • The CPU’s translation lookaside buffer (TLB) caches recent address translations. Accessing enough pages to exceed its capacity can hurt performance. section 6.4.3
  • An inactive page can be swapped to disk and brought back when needed. Requesting a valid address whose page is not in RAM raises a page fault, signaling that the operating system must restore it. section 6.4.1 section 6.4.3

Inspecting a running program

A tool that inspects a running program’s values works with the program’s view of memory. Pages help explain why those virtual addresses require translation before the underlying memory can be accessed. section 6.4.1 section 6.4.3

How Rust in Action: Systems programming concepts and techniques covers it

How deep it goes
Defines page size and explains mapping efficiency, fragmentation, caching, and swapping without detailing page-table layouts.
Examples
Uses running-program value inspection as motivation and contrasts page-based translation with mapping every variable separately.
What it assumes
Introduces virtual and real memory terminology alongside pages, page faults, and swapping rather than assuming those terms are familiar.
What you can do after
Evaluate/understand it by explaining why address translation groups memory into pages and why an inactive page may reside on disk.
How it connects
Connects pages to virtual memory, page tables, memory fragmentation, swapping, page faults, and the translation lookaside buffer.

Also explained in

Compare how 2 books explain memory page →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Rust in Action: Systems programming concepts and techniques. The section links point to the parts of the book it draws on.