What’s a page fault?

Print anything with Printful



Page faults occur when a program tries to access information not in physical memory, which is then loaded from virtual memory. This is normal, but an invalid or protected address can cause a crash due to bad hardware or software.

A page fault is an operation that occurs on a computer with virtual memory, a technique that allows part of a hard drive to increase the computer’s physical memory. Most page faults occur when a program tries to access information that has been placed in the scratch file on your hard drive. This is a normal function of virtual memory and the computer will respond by loading the appropriate information into physical memory. A more serious type of page fault associated with computer crashes and errors can occur when a program looks for information in a memory location that does not exist or is protected. This can be caused by bad hardware or poorly written software.

Modern computer systems divide memory into smaller chunks known as pages, with each page being accessed from a specific address. Most systems also support a concept known as virtual memory, where pages can be moved from the computer’s physical Random Access Memory (RAM) and into a virtual memory file stored on the computer’s hard drive and back into RAM as needed . The details of this complex memory management scheme are hidden by the software; an application has no way of knowing whether or not a page at a given address is loaded in RAM or is in virtual memory. A page fault occurs when a program tries to read or manipulate a portion of memory that is not loaded into RAM or is located at an unexpected address.

Despite the ominous name, a page fault is generally a normal and expected action, and most of the time a user will never notice that the error has occurred. This is known as a “trap,” which means that instructions from the program that triggered the error are temporarily intercepted or trapped while the computer examines the memory address in question. If the address is valid, but is not currently loaded into the computer’s RAM, the information is transferred from the virtual memory file on the hard disk to physical memory and the program resumes normal operation. This is known as “swapping in” or “paging in” and is common to nearly all personal computers, regardless of the operating system or amount of RAM installed. Too little RAM, however, causes the computer to constantly mix memory pages between the hard drive and physical memory, resulting in degraded performance.

The second possible outcome of a page fault occurs when a requested memory address is invalid or protected. This type of error, also known as a segmentation fault, can be caused by failed memory modules, defective hard drives, or misbehaving software. A special signal is sent to the program that triggered the error, which usually causes the program to crash abruptly. Depending on the operating system, more serious page faults can cause a computer’s operating system to fail, leaving users with a cryptic Blue Screen of Death (BSoD) message or kernel panic.




Protect your devices with Threat Protection by NordVPN


Skip to content