Memory Management · Operating System
67 questions · asked in 27 of 27 years (2000–2026)
MCQ 43 · MSQ 4 · NAT 201-mark 36 · 2-mark 31
2000Questions per year2026
Questions 21–25 of 67
Recall that Belady's anomaly is that the pages-fault rate may increase as the number of allocated frames increases. Now consider the following statements:
S1: Random page replacement algorithm (where a page chosen at random is replaced) suffers from Belady's anomaly
S2: LRU page replacement algorithm suffers from Belady's anomaly
Which of the following is CORRECT ?
S1: Random page replacement algorithm (where a page chosen at random is replaced) suffers from Belady's anomaly
S2: LRU page replacement algorithm suffers from Belady's anomaly
Which of the following is CORRECT ?
Answer: (B)
- S1: Random replacement is not a stack algorithm. The pages held with k frames need not be a subset of the pages held with k + 1 frames, because the random choices differ. So adding a frame can lead to more faults, and Belady's anomaly can occur. S1 is TRUE.
- S2: LRU is a stack algorithm. With k frames it holds the k most recently used pages, and these are always a subset of the k + 1 most recently used pages. So more frames never add faults, and Belady's anomaly does not occur. S2 is FALSE.
Answer: (B)
- S2: LRU is a stack algorithm. With k frames it holds the k most recently used pages, and these are always a subset of the k + 1 most recently used pages. So more frames never add faults, and Belady's anomaly does not occur. S2 is FALSE.
Answer: (B)
A processor can support a maximum memory of 4GB, where the memory is word-addressable (a word consists of two bytes). The size of the address bus of the processor is at least ________ bits.
Answer: 31
The memory is 4 GB, which is bytes. Each word has 2 bytes, so the memory holds words.
The memory is word addressable, so we get addresses 31 address bits.
Answer: 31
The memory is word addressable, so we get addresses 31 address bits.
Answer: 31
Consider a computer system with 40-bit virtual addressing and page size of sixteen kilobytes. If the computer system has a one level page table per process and each page table entry requires 48 bits, then the size of the per-process page table is _________ mega bytes.
Answer: 384
Number of page table entries: . Every entry takes 48 bits, which is 6 bytes.
Page table size: MB
Answer: 384
Page table size: MB
Answer: 384
Consider a computer system with ten physical page frames. The system is provided with an access sequence , where each is a distinct virtual page number. The difference in the number of page faults between the last-in-first-out page replacement policy and the optimal page replacement policy is ______.
Answer: 1
With 10 frames, the first pass over a1 to a20 has 20 faults for every policy, because all the pages are new.
LIFO: a1 to a10 fill the frames. Each of a11 to a20 then replaces the page loaded last (a11 replaces a10, a12 replaces a11, and so on). After the first pass the frames hold a1 to a9 and a20. In the second pass, a1 to a9 are hits. a10 faults and replaces a20 (the last page loaded), and each of a11 to a20 faults and replaces the one before it. That is 11 faults (a10 to a20). Total = 20 + 11 = 31.
Optimal: In the first pass, a11 replaces a10, which is needed farthest in the future, a12 replaces a11, and so on. So the frames also end the first pass holding a1 to a9 and a20. In the second pass, a1 to a9 are hits. a10 faults and replaces a page that is never needed again (one of a1 to a9). a11 to a19 fault in the same way, each replacing a page that is never needed again. a20 is still in memory, so it is a hit. That is 10 faults (a10 to a19). Total = 20 + 10 = 30.
Difference = 31 30 = 1
Answer: 1
LIFO: a1 to a10 fill the frames. Each of a11 to a20 then replaces the page loaded last (a11 replaces a10, a12 replaces a11, and so on). After the first pass the frames hold a1 to a9 and a20. In the second pass, a1 to a9 are hits. a10 faults and replaces a20 (the last page loaded), and each of a11 to a20 faults and replaces the one before it. That is 11 faults (a10 to a20). Total = 20 + 11 = 31.
Optimal: In the first pass, a11 replaces a10, which is needed farthest in the future, a12 replaces a11, and so on. So the frames also end the first pass holding a1 to a9 and a20. In the second pass, a1 to a9 are hits. a10 faults and replaces a page that is never needed again (one of a1 to a9). a11 to a19 fault in the same way, each replacing a page that is never needed again. a20 is still in memory, so it is a hit. That is 10 faults (a10 to a19). Total = 20 + 10 = 30.
Difference = 31 30 = 1
Answer: 1
In which one of the following page replacement algorithms it is possible for the page fault rate to increase even when the number of allocated frames increases?
Answer: (D)
This effect is called Belady's anomaly, and it occurs with FIFO. LRU, OPT and MRU are stack algorithms. When the frames increase, the set of pages kept in memory only becomes larger, so the faults never go up.
Answer: FIFO
Answer: FIFO
Keep practising
Topics in Operating System
System CallProcessThreadProcess SynchronizationDeadlockCPU SchedulingDisk Scheduling
Memory ManagementYou are here
File Systems