When Does Page Fault Occur?
A page fault is a trap that occurs when the requested page is not loaded into the memory, in other words, when a program tries to access a chunk of memory that does not exist in physical memory (main memory) causes a page fault.
Transform Your Career
Choose from our industry-leading programs designed for career success
Modern Software and AI Engineering Program
Master full-stack development with AI integration
+1000 moreModern Data Science and ML with specialisation in AI
Advanced data science techniques with AI specialization
+1000 moreAdvanced AIML with Specialisation in Agentic AI
Deep dive into AIML with focus on Agentic systems
+1000 moreDevOps, Cloud & AI Platform Engineering
Build and manage AI-powered cloud infrastructure
+1000 moreAI Engineering Advanced Certification by IIT-Roorkee
Premier AI engineering certification from IIT-Roorkee
What is a Page Fault in the OS?
In operating systems, a page fault is an exception/error that is raised by the memory management unit if a process accesses a memory page without it being loaded into the memory. A mapping is required to be added to the virtual address space of the process to access the page. The page contents are loaded from a backing store (secondary storage), such as a disk. The page fault is detected by the memory management unit, but the operating system's kernel handles the exception by making the required page accessible in the physical memory or denying illegal memory access.

Describe the Actions Taken by the Operating System When a Page Fault Occurs.
When a page fault occurs, the following sequence of events happens:
- At first, an internal table is created to process whether the reference was valid or invalid memory access.
- The system gets terminated if the reference becomes invalid, if not, the page will be paged in.
- After checking for validity, the free-frame list searches the system for a free frame.
- The disk operation will be scheduled to get the required page from the disk.
- The page table of the process will be updated with a new frame number, and the invalid bit will be changed after the completion of the I/O operation. Now it is a valid page reference.
- Restart these steps upon finding any more page faults.
Learn About Page Replacement Algorithms
A page replacement algorithm is needed to decide which page needs to be replaced when a new page comes in. These are used in operating systems that use paging for memory management.
To learn more about page replacement algorithms, follow the below link
Scaler Placement Report and Statistics
Scaler learners achieved 2.5x salary growth with average post-Scaler CTC reaching ₹23L.
Conclusion
- Page faults occur when a requested page is not loaded into the memory.
- Page faults are detected by the Memory Management Unit (MMU).
- Page replacement algorithms are used to minimize the number of page faults.




