Skip to content

Page Fault

Medium — good to knowBackend

ELI5 - The Vibe Check

A page fault happens when your program reaches for a piece of memory that isn't actually sitting in physical RAM yet, maybe it was swapped out, maybe it's a brand new page the OS hasn't bothered to allocate until now, and the CPU has to pause and ask the operating system to go fetch or create it. Some page faults are normal and nearly free, others mean your program just hit disk and got a lot slower for a moment.

Real Talk

A page fault is a trap raised by the CPU's memory management unit when a program accesses a virtual memory page that isn't currently mapped to physical memory. Minor page faults are resolved quickly by the OS, allocating a fresh page or finding it already in the page cache, while major page faults require reading from disk, which is orders of magnitude slower and a common hidden cause of latency spikes.

When You'll Hear This

"The latency spike lined up exactly with a spike in major page faults, we were swapping." / "Pre-touching the allocated memory avoids page faults during the hot path."

Made with passive-aggressive love by manoga.digital. Powered by Claude.