Demand Paging
Q.1: How does demand paging differ from swapping?
Answer:
Demand paging is a method for loading only the necessary parts of a program into RAM as needed, while swapping involves moving entire processes in and out of RAM. Demand paging is more granular and efficient.
Q.2: What happens during a page fault?
Answer:
When a page fault occurs, the operating system:
- Identifies the missing page.
- Retrieves it from secondary storage.
- Updates the page table to reflect the new location in RAM.
- Resumes the interrupted process.
Q.3: What are some strategies to optimize demand paging?
Answer:
- Use efficient page replacement algorithms.
- Adjust the size of the page file or swap space.
- Ensure sufficient physical memory to reduce page faults.
- Profile and optimize applications to minimize memory usage.
What is Demand Paging in Operating System?
The concept of query navigation in the operating system. This concept says that we should not load any pages into the main memory until we need them, or keep all pages in secondary memory until we need them.