Operating systems notes

Virtual Memory & Demand Paging

How a machine runs programs far larger than its RAM by keeping only the pages you actually touch in memory, and fetching the rest from disk, one fault at a time. Every section is a drawn page beside a clear written explanation, about 19 minutes in all.

  • Chapter 23 of 37
  • About 19 minutes
  • 9 sections

Sign in with Google or GitHub and you land straight on this page. DSA comes with the all labs plan and every ChaiCode batch.

The first drawn page of Virtual Memory & Demand Paging: The big illusion: more address space than RAM
The chapter's first page: The big illusion: more address space than RAM

In this chapter

  • The big illusion: more address space than RAM
  • Demand paging: don't load it until it's touched
  • The page fault, step by step
  • Minor vs major faults
  • Locality and the working set: why this works at all
  • Copy-on-write: making fork() cheap
  • Memory-mapped files: mmap
  • The page cache: unused RAM is wasted RAM
  • Effective access time, and why engineers care

Next chapters

Read the whole chapter

Sign in and the chapter opens with every drawn page, and all 38 operating systems chapters beside it.

DSA comes with the all labs plan and every ChaiCode batch.