Operating Systems · Pro · Topic 2 of 4
Page Replacement & Thrashing
4 questions.
Your progress0%
- 1st Visit
- 0/4
- 2nd Visit
- 0/4
- Revise
- 0/4
Overview
When a page fault occurs and every frame is full, the operating system must choose a page to evict. The choice strongly affects performance, because evicting a page that is needed soon causes another fault. FIFO evicts the oldest page, LRU evicts the least recently used page, and the Optimal algorithm evicts the page needed furthest in the future, which is the theoretical best and serves as a benchmark. Real systems approximate LRU cheaply with reference bits, as in the clock algorithm. If processes together have too few frames, the system starts thrashing. Interviewers expect you to count page faults by hand and to explain Belady's anomaly and thrashing.
Questions
| # | Problem | Platform | Difficulty | Open | 1st1st Visit | 2nd2nd Visit | RevRevise |
|---|---|---|---|---|---|---|---|
| 1 | Compare FIFO, LRU and Optimal page replacement. | Concept | Medium | Read the answer to Compare FIFO, LRU and Optimal page replacement. | |||
| 2 | What is Belady's anomaly? | Concept | Medium | Read the answer to What is Belady's anomaly? | |||
| 3 | Why is exact LRU expensive, and how does the clock algorithm approximate it? | Concept | Hard | Read the answer to Why is exact LRU expensive, and how does the clock algorithm approximate it? | |||
| 4 | What is thrashing, why does it happen, and how can it be prevented? | Concept | Hard | Read the answer to What is thrashing, why does it happen, and how can it be prevented? |