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 31–35 of 67
Assume that there are 3 page frames which are initially empty. If the page reference string 1, 2, 3, 4, 2, 1, 5, 3, 2, 4, 6, the number of page faults using the optimal replacement policy is ______
Answer: 7
Use the optimal policy with 3 frames. On a fault, remove the page whose next use is furthest away in the future.
1 F, 2 F, 3 F, 4 F (remove 3), 2, 1, 5 F (remove 1), 3 F (remove 5), 2, 4, 6 F
Total faults = 7
Answer: 7
1 F, 2 F, 3 F, 4 F (remove 3), 2, 1, 5 F (remove 1), 3 F (remove 5), 2, 4, 6 F
Total faults = 7
Answer: 7
A computer has twenty physical page frames which contain pages numbered 101 through 120. Now a program accesses the pages numbered 1, 2, ..., 100 in that order, and repeats the access sequence THRICE. Which one of the following page replacement policies experiences the same number of page faults as the optimal page replacement policy for this program?
Answer: (D)
Pages 1 to 100 are accessed in a cycle, three times, and only 20 frames are available. Take pages 101 to 120 as dead, since they are never used again, so they are replaced first.
LRU and FIFO: in a cycle longer than the memory, the page used (or loaded) longest ago is the page needed soonest. They throw it out every time, so every access faults: faults.
Optimal: it evicts the page whose next use is farthest away. In a cycle, that is the page just used. After the first pass, pages 1 to 19 and 100 stay in memory. Each of passes 2 and 3 then has 20 hits and 80 faults, so the total is faults.
MRU: it evicts the most recently used page, which is exactly the page optimal evicts here. So it makes the same choices and gives the same 260 faults.
LIFO: it evicts the page loaded last, and a hit does not change the load order. At the start of pass 2 it evicts page 100 instead, so it gets 262 faults, slightly worse than optimal.
Answer: (D)
LRU and FIFO: in a cycle longer than the memory, the page used (or loaded) longest ago is the page needed soonest. They throw it out every time, so every access faults: faults.
Optimal: it evicts the page whose next use is farthest away. In a cycle, that is the page just used. After the first pass, pages 1 to 19 and 100 stay in memory. Each of passes 2 and 3 then has 20 hits and 80 faults, so the total is faults.
MRU: it evicts the most recently used page, which is exactly the page optimal evicts here. So it makes the same choices and gives the same 260 faults.
LIFO: it evicts the page loaded last, and a hit does not change the load order. At the start of pass 2 it evicts page 100 instead, so it gets 262 faults, slightly worse than optimal.
Answer: (D)
A system uses 3 page frames for storing process pages in main memory. It uses the Least Recently Used (LRU) page replacement policy. Assume that all the page frames are initially empty. What is the total number of page faults that will occur while processing the page reference string given below? 4, 7, 6, 1, 7, 6, 1, 2, 7, 2
Answer: 6
LRU with 3 frames:
- 4, 7, 6: all faults (3)
- 1: fault, 4 is removed {7, 6, 1} (4)
- 7, 6, 1: all hits
- 2: fault, LRU page 7 is removed {6, 1, 2} (5)
- 7: fault, 6 is removed {1, 2, 7} (6)
- 2: hit
Answer: 6
- 4, 7, 6: all faults (3)
- 1: fault, 4 is removed {7, 6, 1} (4)
- 7, 6, 1: all hits
- 2: fault, LRU page 7 is removed {6, 1, 2} (5)
- 7: fault, 6 is removed {1, 2, 7} (6)
- 2: hit
Answer: 6
Consider a paging hardware with a TLB. Assume that the entire page table and all the pages are in the physical memory. It takes 10 milliseconds to search the TLB and 80 milliseconds to access the physical memory. If the TLB hit ratio is 0.6, the effective memory access time (in milliseconds) is _________.
Answer: 122
Work out the time for each case:
- TLB hit: 10 + 80 = 90
- TLB miss: 10 + 80 (page table) + 80 (data) = 170
Effective memory access time (EMAT) = 0.6 90 + 0.4 170 = 54 + 68 = 122
Answer: 122
- TLB hit: 10 + 80 = 90
- TLB miss: 10 + 80 (page table) + 80 (data) = 170
Effective memory access time (EMAT) = 0.6 90 + 0.4 170 = 54 + 68 = 122
Answer: 122
A computer uses 46-bit virtual address, 32-bit physical address, and a three-level paged page table organization. The page table base register stores the base address of the first-level table
(T1) ,which occupies exactly one page. Each entry of T1 stores the base address of a page of the second-level table (T2 ) Each entry of T2 stores the base address of a page of the third-level table (T3 ) Each entry of T3 stores a page table entry (PTE). The PTE is 32 bits in size. The processor used in the computer has a 1 MB 16 way set associative virtually indexed physically tagged cache. The cache block size is 64 bytes.
What is the minimum number of page colours needed to guarantee that no two synonyms map to different sets in the processor cache of this computer?
What is the minimum number of page colours needed to guarantee that no two synonyms map to different sets in the processor cache of this computer?
Answer: (C)
Page size. A PTE is 32 bits = 4 bytes. Let the page size be bytes. Each table fits in one page, so it has entries and is indexed by bits. With three levels, the virtual address is bits, so and the page size is 8 KB.
Cache. Number of sets = . The block offset takes 6 bits and the set index 10 bits, so 16 address bits decide the set.
The page offset has only 13 bits, which are the same for synonyms. The other bits of the set index come from the virtual page number, and two synonyms may differ there. To make sure they land in the same set, these 3 bits must be equal, so we need page colours.
Answer: (C)
Cache. Number of sets = . The block offset takes 6 bits and the set index 10 bits, so 16 address bits decide the set.
The page offset has only 13 bits, which are the same for synonyms. The other bits of the set index come from the virtual page number, and two synonyms may differ there. To make sure they land in the same set, these 3 bits must be equal, so we need page colours.
Answer: (C)
Keep practising
Topics in Operating System
System CallProcessThreadProcess SynchronizationDeadlockCPU SchedulingDisk Scheduling
Memory ManagementYou are here
File Systems