$linuxjunkies
>

major page fault

also: hard page fault, major fault

A page fault that occurs when a program accesses virtual memory that is not currently loaded in physical RAM and must be fetched from disk, typically causing a noticeable delay. This is in contrast to a minor page fault, where the page is already in RAM but needs to be mapped into the process's address space.

A major page fault (also called a hard page fault) happens when the CPU attempts to access a virtual memory address that isn't present in physical RAM. The operating system must then suspend the process, retrieve the page from disk (swap space or a file), load it into memory, and resume execution—a relatively expensive operation.

Major page faults are inevitable when a program first starts (since its code and data must be loaded from disk) or when it accesses memory regions that have been swapped out. However, excessive major page faults indicate memory pressure: the system is swapping heavily to disk, which is much slower than RAM access.

You can monitor major page faults using tools like ps, time, or /proc/[pid]/stat. For example, running time ./myprogram shows the count of major faults under the output. A program with thousands of major faults is likely thrashing—spending more time swapping than computing.

Related terms