1What is a page fault?
A page fault occurs when a process tries to use a page that is not in memory, causing an operating system interrupt.
2When does a page fault occur?
A page fault occurs when a page that is needed is not loaded in memory.
3What is the first step in handling a page fault?
The page table is checked for the memory reference.
4What happens if the desired page is not in memory during a page fault?
A page fault trap occurs, which is an operating system interrupt.
5How does the OS handle a missing page in memory?
The OS locates the page on auxiliary storage (disk) and loads it into a free memory frame.
6What must the OS do after loading the page into memory?
The OS resets the page table to mark the page as valid and restarts the instruction that caused the page fault.
7When does page replacement occur?
Page replacement occurs when there are no free frames available to load a missing page.
8What is the goal of a page replacement algorithm?
To find a frame to free in order to reduce page faults.
9How is a frame freed during page replacement?
A victim page is selected, its contents are copied to disk if modified, the page table is updated to mark it invalid, and the frame is then available.
10What factors are considered when selecting a page replacement algorithm?
The algorithm is chosen to have the lowest page fault rate.
11Name some types of page replacement algorithms.
FIFO (First In First Out), Optimal, Least Recently Used (LRU), Random, Second Chance.
12What is the FIFO page replacement algorithm?
FIFO replaces the oldest page in memory based on the age of pages.
13How many page faults occur in the FIFO example with 3 frames?
15 page faults.
14What is Belady’s Anomaly?
It is when increasing the number of memory frames causes an increase in page faults, observed in some algorithms like FIFO.
15Which algorithm has the lowest page fault rate and does not suffer from Belady’s anomaly?
The Optimal page replacement algorithm.
16How does the Optimal algorithm choose a page to replace?
It replaces the page that will not be used for the longest period in the future.
17Why is the Optimal algorithm difficult to implement?
It requires knowledge of future memory references, which is generally not available.
18What is the LRU (Least Recently Used) page replacement algorithm?
LRU replaces the page that has not been used for the longest period, based on past usage history.
19What is needed for LRU implementation?
Hardware assistance to track and order frames by their last used time.
20How does the Random page replacement algorithm work?
It selects any page at random to replace.
21What is the Second Chance algorithm?
A variation of FIFO where pages with a set reference bit are given a second chance and moved to the end of the queue before replacement.
22What is thrashing in memory management?
Thrashing occurs when high page replacement activity causes processes to spend more time paging than executing, reducing CPU utilization and system throughput.