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 1–5 of 67
Consider a system that has a cache memory unit and a memory management unit (MMU). The address input to the cache memory is a physical address. The MMU has a translation lookaside buffer (TLB). Assume that when a page is evicted from the main memory, the corresponding blocks in the cache are marked as invalid.
For a given memory reference, which of the following sequences of events can NEVER happen?
For a given memory reference, which of the following sequences of events can NEVER happen?
One or more options are correct.
Answer: (B), (C)
A memory reference goes through these steps in order: first the TLB, then the page table (only when the TLB misses), and then the cache.
- TLB miss, Page table hit, Cache hit: This is possible. The TLB does not hold the mapping, but the page table does, so the page is in memory. The cache block for that page can still be valid, so a cache hit can occur. Can happen.
- TLB hit, Page table miss, Cache hit: Impossible. A TLB hit means the page is mapped and present in memory, because TLB entries are valid only for pages that are in memory. So the page table cannot report a miss (page not in memory) for that same page.
- TLB miss, Page table miss, Cache hit: Impossible. A page table miss means the page is not in main memory at all. The problem says that when a page is evicted, its cache blocks are marked invalid. So if the page is not in memory, its cache blocks cannot be valid, and a cache hit cannot happen.
- TLB miss, Page table miss, Cache miss: This is possible. It is the expected sequence when the page is really not in memory.
Answer: "TLB hit, Page table miss, Cache hit" and "TLB miss, Page table miss, Cache hit" can NEVER happen.
- TLB miss, Page table hit, Cache hit: This is possible. The TLB does not hold the mapping, but the page table does, so the page is in memory. The cache block for that page can still be valid, so a cache hit can occur. Can happen.
- TLB hit, Page table miss, Cache hit: Impossible. A TLB hit means the page is mapped and present in memory, because TLB entries are valid only for pages that are in memory. So the page table cannot report a miss (page not in memory) for that same page.
- TLB miss, Page table miss, Cache hit: Impossible. A page table miss means the page is not in main memory at all. The problem says that when a page is evicted, its cache blocks are marked invalid. So if the page is not in memory, its cache blocks cannot be valid, and a cache hit cannot happen.
- TLB miss, Page table miss, Cache miss: This is possible. It is the expected sequence when the page is really not in memory.
Answer: "TLB hit, Page table miss, Cache hit" and "TLB miss, Page table miss, Cache hit" can NEVER happen.
A system has a Translation Lookaside Buffer (TLB) that has a reach of MB. TLB reach is defined as the total amount of physical memory that can be accessed through the TLB entries. The paging system uses pages of size KB. The virtual address space is GB and physical address space is GB. If each TLB entry stores a -bit process id, page number, frame number, and a -bit control field, then the size of the TLB (in bytes) is ________. (answer in integer)
Note:
Note:
Answer: 1536
The TLB reach the page size the number of TLB entries. So the number of entries is found as:
The virtual address space bytes, so the virtual page number needs bits, where the page size is .
The physical address space bytes, so the frame number needs bits.
One TLB entry holds a -bit PID a -bit page number a -bit frame number a -bit control field. This gives bits, which bytes per entry.
Total TLB size: bytes.
Answer: 1536
The virtual address space bytes, so the virtual page number needs bits, where the page size is .
The physical address space bytes, so the frame number needs bits.
One TLB entry holds a -bit PID a -bit page number a -bit frame number a -bit control field. This gives bits, which bytes per entry.
Total TLB size: bytes.
Answer: 1536
Consider contiguous allocation of physical memory to processes using variable partitioning scheme. Suppose there are holes in the memory of sizes , , and . Assume that no two holes are adjacent. Two processes of size and of size arrive in that order, and they are allocated memory using the best-fit technique. After allocating space to and , the number of holes of size less than is ________. (answer in integer)
Note:
Note:
Answer: 3
Best-fit chooses the smallest hole that is big enough for the request.
Holes at the start (KB): .
P1 (16 KB): among the holes , the smallest is . P1 goes in this hole, and a hole of KB is left. The holes are now: .
P2 (9 KB): among the holes , the smallest is the KB hole, which fits exactly. It is used up completely and no hole is left from it. The holes are now: ( holes left).
Now count the holes smaller than KB in . They are KB, KB and KB. That makes holes.
Answer: 3
Holes at the start (KB): .
P1 (16 KB): among the holes , the smallest is . P1 goes in this hole, and a hole of KB is left. The holes are now: .
P2 (9 KB): among the holes , the smallest is the KB hole, which fits exactly. It is used up completely and no hole is left from it. The holes are now: ( holes left).
Now count the holes smaller than KB in . They are KB, KB and KB. That makes holes.
Answer: 3
Consider a demand paging memory management system with 32-bit logical address, 20-bit physical address, and page size of 2048 bytes. Assuming that the memory is byte addressable, what is the maximum number of entries in the page table?
Answer: (A)
The page size bytes. So the offset field of the page needs bits.
The logical address has bits. The bits left over make the page number: bits.
The page table has one entry for each possible page number. So the maximum number of entries .
Answer:
The logical address has bits. The bits left over make the page number: bits.
The page table has one entry for each possible page number. So the maximum number of entries .
Answer:
In optimal page replacement algorithm, information about all future page references is available to the operating system (OS). A modification of the optimal page replacement algorithm is as follows:
The OS correctly predicts only up to next 4 page references (including the current page) at the time of allocating a frame to a page.
A process accesses the pages in the following order of page numbers:
1, 3, 2, 4, 2, 3, 1, 2, 4, 3, 1, 4.
If the system has three memory frames that are initially empty, the number of page faults that will occur during execution of the process is _________. (Answer in integer)
The OS correctly predicts only up to next 4 page references (including the current page) at the time of allocating a frame to a page.
A process accesses the pages in the following order of page numbers:
1, 3, 2, 4, 2, 3, 1, 2, 4, 3, 1, 4.
If the system has three memory frames that are initially empty, the number of page faults that will occur during execution of the process is _________. (Answer in integer)
Answer: 6
The OS sees only the next 4 references, the current one included. At a fault with no free frame, it removes the page in memory whose next use is farthest inside this window. A page that does not appear in the window counts as farthest.
Reference string (positions 1 to 12): 1, 3, 2, 4, 2, 3, 1, 2, 4, 3, 1, 4. Three frames, all empty at the start.
The first three references fill the empty frames, giving 3 faults.
Reference 4 (position 4): window is 4, 2, 3, 1. Pages in memory are 1, 3, 2, used at positions 7, 6, 5. Page 1 is farthest, so it is replaced.
Reference 1 (position 7): window is 1, 2, 4, 3. Pages in memory are 4, 3, 2, used at positions 9, 10, 8. Page 3 is farthest, so it is replaced.
Reference 3 (position 10): window is 3, 1, 4 (only these are left). Pages in memory are 4, 2, 1. Page 2 is not in the window, so it is replaced.
Total faults (at references 1, 3, 2, 4, 1, 3).
Answer: 6
Reference string (positions 1 to 12): 1, 3, 2, 4, 2, 3, 1, 2, 4, 3, 1, 4. Three frames, all empty at the start.
The first three references fill the empty frames, giving 3 faults.
Reference 4 (position 4): window is 4, 2, 3, 1. Pages in memory are 1, 3, 2, used at positions 7, 6, 5. Page 1 is farthest, so it is replaced.
Reference 1 (position 7): window is 1, 2, 4, 3. Pages in memory are 4, 3, 2, used at positions 9, 10, 8. Page 3 is farthest, so it is replaced.
Reference 3 (position 10): window is 3, 1, 4 (only these are left). Pages in memory are 4, 2, 1. Page 2 is not in the window, so it is replaced.
Total faults (at references 1, 3, 2, 4, 1, 3).
Answer: 6
Keep practising
Topics in Operating System
System CallProcessThreadProcess SynchronizationDeadlockCPU SchedulingDisk Scheduling
Memory ManagementYou are here
File Systems