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 61–65 of 67
A processor uses 2-level page tables for virtual to physical address translation. Page tables for both levels are stored in the main memory. Virtual and physical addresses are both 32 bits wide. The memory is byte addressable. For virtual to physical address translation, the 10 most significant bits of the virtual address are used as index into the first level page table while the next 10 bits are used as index into the second level page table. The 12 least significant bits of the virtual address are used as offset within the page. Assume that the page table entries in both levels of page tables are 4 bytes wide. Further, the processor has a translation look-aside buffer (TLB), with a hit rate of 96%. The TLB caches recently used virtual page numbers and the corresponding physical page numbers. The processor also has a physically addressed cache with a hit rate of 90%. Main memory access time is 10 ns, cache access time is 1 ns, and TLB access time is also 1 ns.
Assuming that no page faults occur, the average time taken to access a virtual address is approximately (to the nearest 0.5 ns)
Assuming that no page faults occur, the average time taken to access a virtual address is approximately (to the nearest 0.5 ns)
Answer: (D)
The cache is physically addressed, so every access needs a translation first. Assume page-table entries are read directly from main memory, and main memory is read only after a cache miss.
TLB: accessed every time, 1 ns.
TLB miss (4%): two page-table reads from memory, ns.
Cache and memory: ns. (A miss costs the cache check plus the memory access.)
Average = ns, which is 4 ns to the nearest 0.5 ns.
Answer: (D)
TLB: accessed every time, 1 ns.
TLB miss (4%): two page-table reads from memory, ns.
Cache and memory: ns. (A miss costs the cache check plus the memory access.)
Average = ns, which is 4 ns to the nearest 0.5 ns.
Answer: (D)
In a system with 32 bit virtual addresses and 1 KB page size, use of one-level page tables for virtual to physical address translation is not practical because of
Answer: (C)
A one-level page table needs one entry per virtual page: entries. With 4 bytes per entry that is 16 MB for every process, and it must stay in memory. This is a large memory overhead.
(A) Internal fragmentation is the unused part of a process's last page, at most one page. It does not depend on the number of page-table levels, and with 1 KB pages it is small.
(B) Paging has no external fragmentation, because all frames are the same size.
(D) Translation is one table lookup and an addition of the offset. The time cost is not the problem.
Answer: (C)
(A) Internal fragmentation is the unused part of a process's last page, at most one page. It does not depend on the number of page-table levels, and with 1 KB pages it is small.
(B) Paging has no external fragmentation, because all frames are the same size.
(D) Translation is one table lookup and an addition of the offset. The time cost is not the problem.
Answer: (C)
The optimal page replacement algorithm will select the page that
Answer: (B)
The optimal page replacement algorithm always replaces the page that will not be used for the longest time in the future. This is why it is called optimal page replacement. So the answer is choice (B).
Consider a machine with 64 MB physical memory and a 32-bit virtual address space. If the page size is 4 KB, what is the approximate size of the page table ?
Answer: (C)
The virtual address space is bytes and a page is bytes. So the number of pages is . The page table needs one entry for each page, so it has entries.
Physical memory is bytes, so a physical address has 26 bits. Subtract the 12 offset bits, so the frame number needs bits. So each entry needs at least 14 bits, which we round up to 2 bytes.
Page table size . (With exactly 14 bits per entry it would be , and the nearest option is still 2 MB.)
Answer: (C)
Physical memory is bytes, so a physical address has 26 bits. Subtract the 12 offset bits, so the frame number needs bits. So each entry needs at least 14 bits, which we round up to 2 bytes.
Page table size . (With exactly 14 bits per entry it would be , and the nearest option is still 2 MB.)
Answer: (C)
Consider a virtual memory system with FIFO page replacement policy. For an arbitrary page access pattern, increasing the number of page frames in main memory will.
Answer: (C)
This is Belady's anomaly. With FIFO, for some reference strings, adding page frames gives more page faults, not fewer.
Example: reference string 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5.
With 3 frames, FIFO gives 9 faults (faults on 1, 2, 3, 4, 1, 2, 5, 3, 4).
With 4 frames, FIFO gives 10 faults (faults on 1, 2, 3, 4, 5, 1, 2, 3, 4, 5).
So more frames gave more faults here.
So (A) and (B) are wrong because the number of faults does not always go down, and it does not always go up (for most strings more frames give fewer faults). (D) is wrong because the number of frames clearly affects the faults. The right choice is that more frames sometimes increase the faults.
Answer: (C)
Example: reference string 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5.
With 3 frames, FIFO gives 9 faults (faults on 1, 2, 3, 4, 1, 2, 5, 3, 4).
With 4 frames, FIFO gives 10 faults (faults on 1, 2, 3, 4, 5, 1, 2, 3, 4, 5).
So more frames gave more faults here.
So (A) and (B) are wrong because the number of faults does not always go down, and it does not always go up (for most strings more frames give fewer faults). (D) is wrong because the number of frames clearly affects the faults. The right choice is that more frames sometimes increase the faults.
Answer: (C)
Keep practising
Topics in Operating System
System CallProcessThreadProcess SynchronizationDeadlockCPU SchedulingDisk Scheduling
Memory ManagementYou are here
File Systems