Skip to content

Demand paging

A virtual-memory policy that loads a page into physical memory only after an attempted access faults on that absent page.

Core Idea

It separates allocation of virtual address space from residency, and performance depends on locality, working-set size, replacement policy, backing storage and fault cost. A page-table entry marks a page nonresident, hardware traps its first access, the operating system obtains a frame and loads the page, updates translation state and resumes the faulting instruction. The abstraction is therefore identified by a declared carrier, a transformation or constraint over that carrier, and an invariant that tells an analyst whether the named structure is genuinely present.

How would you explain it like I'm…

Fetch the Page When Needed

Imagine a giant storybook kept down in the basement, and you have only a small desk. Instead of carrying the whole book up, you fetch a page only when you actually want to read it. If your desk gets full, you send a page you are not using back down. A computer does the same thing with its memory, and that is demand paging.

Load Memory Only When Touched

A computer program acts as if it has lots of memory, but the fast memory (RAM) is limited. With demand paging, the program's memory is split into chunks called pages, and a page is loaded into RAM from slower storage only the first time the program touches it. When that happens, the computer briefly pauses the program, fetches the page, and lets the program carry on as if nothing happened. If RAM is full, it sends an unused page back to storage first. This works well because programs tend to use the same small set of pages for a while, but if a program keeps needing pages that are not loaded, the computer slows to a crawl.

Page-Fault-Driven Memory Loading

Demand paging is an operating-system memory technique where parts of a program's virtual memory are brought into physical RAM only when they are actually accessed. Each process's address space is divided into fixed-size pages, and the page table records whether each page is currently resident in RAM. When the program accesses a page that is not resident, the hardware triggers a page fault. The operating system then finds a free frame (evicting another page if needed, using a replacement policy), loads the page from backing storage such as disk, updates the page table, and restarts the instruction that faulted. This separates reserving address space from actually occupying RAM. Performance depends on locality: if a program's working set of active pages fits in RAM, faults are rare, but if not, the system can thrash, spending most of its time moving pages.

 

Demand paging separates the allocation of virtual address space from residency in physical memory: a process's virtual pages are brought into frames only on first access. A page-table entry marks a page as nonresident; when the process accesses it, the hardware traps with a page fault. The operating system locates the page on backing storage (swap space or a mapped file), obtains a frame, invoking a replacement policy to evict a victim if none is free, loads the page, updates translation state (the page table, and the TLB as needed), and resumes the process by restarting the faulting instruction, which requires the architecture to support precise instruction restart. Performance depends on locality of reference, working-set size relative to available frames, replacement policy, backing-store speed and fault-handling cost. When the combined working sets exceed physical memory, fault rates spike and the system spends most of its time moving pages, the condition called thrashing. A correct account makes explicit the page and process, residency state, the fault, the backing-store location, frame allocation and replacement, load and translation update, restart, and the locality and thrashing conditions.

Scope of Application

Demand paging belongs to operating systems and is useful where the analyst can specify the typed operating systems carrier, including objects, relations, parameters, conventions, evidence, boundaries, and comparison targets, then evaluate the virtual page and process, residency and page-table state, access and page fault, backing-store location, frame allocation and replacement, load and translation update, instruction restart and locality and thrashing conditions are explicit. The scope is broad within that domain but bounded by the need for the virtual page and process, residency and page-table state, access and page fault, backing-store location, frame allocation and replacement, load and translation update, instruction restart and locality and thrashing conditions are explicit.

Clarity

The abstraction clarifies a crowded vocabulary by making the virtual page and process, residency and page-table state, access and page fault, backing-store location, frame allocation and replacement, load and translation update, instruction restart and locality and thrashing conditions are explicit the center of the account. A claim should name the carrier, the governing operation or relation, the applicable assumptions, and the recognition test.

Manages Complexity

Without the abstraction, an analyst must reason directly over many local details: the carrier roles, admissibility assumptions, competing conventions, derived invariants, boundary cases, and proof or validation obligations specific to Demand paging. Demand paging compresses them into the roles in the structural signature. That compression permits comparison across instances without erasing the variables that determine validity. It also exposes which details may be varied safely and which are constitutive.

Abstract Reasoning

  1. Identify the carrier. State what the elements, states, objects, or observations are: the typed operating systems carrier, including objects, relations, parameters, conventions, evidence, boundaries, and comparison targets. Reject examples whose alleged carrier belongs to a different problem.
  2. Lock the constitutive rule. Express the virtual page and process, residency and page-table state, access and page fault, backing-store location, frame allocation and replacement, load and translation update, instruction restart and locality and thrashing conditions are explicit independently of one notation or implementation.

Knowledge Transfer

Knowledge transfers strongly among subfields of operating systems because they reuse the typed operating systems carrier, including objects, relations, parameters, conventions, evidence, boundaries, and comparison targets, A page-table entry marks a page nonresident, hardware traps its first access, the operating system obtains a frame and loads the page, updates translation state and resumes the faulting instruction., and type the carrier, state every parameter and convention in the definition, test that the virtual page and process, residency and page-table state, access and page fault, backing-store location, frame allocation and replacement, load and translation update, instruction restart and locality and thrashing conditions are explicit, compare the nearest accepted identity, and report counterexamples, uncertainty, and limiting cases.

Relationships to Other Abstractions

Local relationship map for Demand pagingParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.Demand pagingDOMAINPrime abstraction: Lazy Evaluation — is a kind ofLazy EvaluationPRIME

Current abstraction Demand paging Domain-specific

Parents (1) — outgoing typed relations

  • Demand paging is a kind of Lazy Evaluation Prime

    It remains its own entry because its identity is fixed by the virtual page and process, residency and page-table state, access and page fault, backing-store location, frame allocation and replacement, load and translation update, instruction restart and locality and thrashing conditions.

Hierarchy paths (2) — routes to 2 parentless roots

Neighborhood in Abstraction Space

Demand paging sits in a crowded region of the domain-specific corpus (12th percentile for distinctiveness): several abstractions share nearly its structure, so a description that fits it tends to fit its neighbors too.

Family — Memory Architecture & Address Spaces (25 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-10-25