---
title: "What is page fault? How is page fault handling in OS?"  
description: "What is page fault? How is page fault handling in OS?"  
author: "Revati S Misra"  
published: 2023-03-31  
updated: 2023-03-31  
canonical: https://www.mindstick.com/forum/157660/what-is-page-fault-how-is-page-fault-handling-in-os  
category: "Operating System"  
tags: ["windows", "operating system"]  
reading_time: 2 minutes  

---

# What is page fault? How is page fault handling in OS?

[Describe](https://www.mindstick.com/interview/12752/what-is-ddms-describe-some-of-its-capabilities) [page](https://www.mindstick.com/articles/13031/why-to-make-a-wikipedia-page) fault and how it can [handle](https://www.mindstick.com/articles/311004/suede-skillet-handle-cover) in [operating systems](https://www.mindstick.com/articles/332551/operating-systems-trends-and-innovations-in-2023).

## Replies

### Reply by Krishnapriya Rajeev

Page fault is a type of *error* that occurs in virtual memory systems when a process attempts to access a page of memory that is not currently present in physical memory. It indicates that the page required by the process is not available in the main memory and *needs to be brought* in from the secondary storage, such as a hard disk.

When a page fault occurs, the operating system takes the following steps to handle it:

- The operating system first checks if the requested page is present in physical memory. If it is not, the operating system raises a page fault exception, indicating that the page is not currently in memory.
- The operating system then looks up the page table to find the location of the requested page on the disk.
- The operating system selects a free page frame in the physical memory and reads the requested page from the disk into the selected page frame.
- Once the page is loaded into the physical memory, the operating system updates the page table to reflect the new location of the page.
- Finally, the operating system restarts the process at the instruction that caused the page fault.
- If there are no free page frames in the physical memory, the operating system uses a *page replacement algorithm* to select a page frame to evict from the physical memory to make room for the requested page. The page replacement algorithm selects the page frame to be evicted based on a specific policy, such as the least recently used (LRU) or the least frequently used (LFU) policy.

In summary, the operating system handles a page fault by bringing the required page into the physical memory from the secondary storage and updating the page table to reflect the new location of the page. However, it may cause overhead due to continuous page swapping and page replacement operations.


---

Original Source: https://www.mindstick.com/forum/157660/what-is-page-fault-how-is-page-fault-handling-in-os

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
