Page Fault
Subject: Computer and Technology noun /ˈpeɪdʒ ˌfɔːlt/ 1 definition
- operating-systems
- memory-management
- virtual-memory
- computer-architecture
-
Definition (noun)
Entry #33 · UpdatedA Page Fault is a hardware exception raised by the processor's memory management unit when a running program accesses a virtual memory address whose page lacks a valid or permitted mapping in the active page table. Upon catching the trap, the operating system kernel checks whether the reference is legal: if valid, it resolves the fault by assigning a physical memory frame, updating page-table entries, or loading the missing page from backing storage before transparently restarting the interrupted instruction; if unauthorized, it aborts the access and signals the offending process. Rather than necessarily indicating a software error, page faults are a routine, foundational mechanism for demand paging, copy-on-write memory sharing, and memory-mapped I/O, while also enforcing memory protection boundaries.
Common Types
Minor (Soft) Page Fault: Occurs when the required page is already resident in physical RAM—such as in the system page cache or a shared library—or only requires allocating a zero-filled or copy-on-write frame, allowing the kernel to update the page table without disk I/O.
Major (Hard) Page Fault: Occurs when the requested page is absent from physical RAM and must be fetched from secondary storage, such as a swap partition or a memory-mapped file on disk, introducing substantial latency while the process waits for I/O.
Invalid Page Fault: Occurs when a program references an unallocated virtual address or violates page permissions, such as attempting to write to read-only memory, causing the kernel to reject the access and deliver a fatal error such as a segmentation fault (
SIGSEGV).
Example
When a video editor opens a 4 GB recording via
mmap(), the Linux kernel assigns virtual address space to the file without loading all four gigabytes into RAM upfront. As the application jumps to an offset halfway through the file and reads that unmapped virtual address, the memory management unit raises a major page fault, prompting the kernel to load the missing 4 KB page from the SSD into physical memory and resume execution transparently.