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 51–55 of 67
A process has been allocated 3 page frames. Assume that none of the pages of the process are available in the memory initially. The process makes the following sequence of page references (reference string): 1, 2, 1, 3, 7, 4, 5, 6, 3, 1.
If optimal page replacement policy is used, how many page faults occur for the above reference string?
If optimal page replacement policy is used, how many page faults occur for the above reference string?
Answer: (A)
Optimal replacement: when all frames are full and a fault occurs, replace the page whose next use is farthest in the future (or that is never used again).
Pages 1, 2, 3 each cause a fault (the second reference to 1 is a hit): 3 faults.
Page 7: the rest of the string is 4, 5, 6, 3, 1. Page 2 is never used again, so replace it. Fault.
Page 4: the rest is 5, 6, 3, 1. Page 7 is never used again, so replace it. Fault.
Page 5: the rest is 6, 3, 1. Page 4 is never used again, so replace it. Fault.
Page 6: the rest is 3, 1. Page 5 is never used again, so replace it. Fault.
Pages 3 and 1 are still in memory, so they are hits.
Total faults .
Answer: (A)
Pages 1, 2, 3 each cause a fault (the second reference to 1 is a hit): 3 faults.
Page 7: the rest of the string is 4, 5, 6, 3, 1. Page 2 is never used again, so replace it. Fault.
Page 4: the rest is 5, 6, 3, 1. Page 7 is never used again, so replace it. Fault.
Page 5: the rest is 6, 3, 1. Page 4 is never used again, so replace it. Fault.
Page 6: the rest is 3, 1. Page 5 is never used again, so replace it. Fault.
Pages 3 and 1 are still in memory, so they are hits.
Total faults .
Answer: (A)
A virtual memory system uses First In First Out (FIFO) page replacement policy and allocates a fixed number of frames to a process. Consider the following statements:
P: Increasing the number of page frames allocated to a process sometimes increases the page fault rate.
Q: Some programs do not exhibit locality of reference.
Which one of the following is TRUE?
P: Increasing the number of page frames allocated to a process sometimes increases the page fault rate.
Q: Some programs do not exhibit locality of reference.
Which one of the following is TRUE?
Answer: (B)
P is true. FIFO shows Bélády's anomaly. For the string 1 2 3 4 1 2 5 1 2 3 4 5, FIFO gives 9 faults with 3 frames but 10 faults with 4 frames.
Q is true. A program that jumps around, for example one that reads a row-major array column by column, has poor locality of reference.
Is Q the reason for P? No. The anomaly occurs because FIFO is not a stack algorithm: with more frames, the set of pages in memory need not contain the set held with fewer frames. It comes from FIFO's eviction rule, not from how a program accesses memory. LRU and optimal are stack algorithms and never show the anomaly, whatever the locality.
So both are true and Q does not explain P.
Answer: (B)
Q is true. A program that jumps around, for example one that reads a row-major array column by column, has poor locality of reference.
Is Q the reason for P? No. The anomaly occurs because FIFO is not a stack algorithm: with more frames, the set of pages in memory need not contain the set held with fewer frames. It comes from FIFO's eviction rule, not from how a program accesses memory. LRU and optimal are stack algorithms and never show the anomaly, whatever the locality.
So both are true and Q does not explain P.
Answer: (B)
For each of the four processes and . The total size in kilobytes (KB) and the number of segments are given below.
The page size is 1 KB. The size of an entry in the page table is 4 bytes. The size of an entry in the segment table is 8 bytes. The maximum size of a segment is 256 KB. The paging method for memory management uses two-level paging, and its storage overhead is P. The storage overhead for the segmentation method is S. The storage overhead for the segmentation and paging method is T. What is the relation among the overheads for the different methods of memory management in the concurrent execution of the above four processes?
The page size is 1 KB. The size of an entry in the page table is 4 bytes. The size of an entry in the segment table is 8 bytes. The maximum size of a segment is 256 KB. The paging method for memory management uses two-level paging, and its storage overhead is P. The storage overhead for the segmentation method is S. The storage overhead for the segmentation and paging method is T. What is the relation among the overheads for the different methods of memory management in the concurrent execution of the above four processes?
Answer: (B)
Paging with 2 levels. The page size is 1 KB and an entry is 4 bytes, so a page holds entries. Assume each page table (outer and inner) is one page in size, since the question does not say. A process of up to 256 pages needs 1 inner table, and a larger one needs 2.
(195 pages), (254) and (45): 1 outer + 1 inner = 2 KB each.
(364 pages, more than 256): 1 outer + 2 inner = 3 KB.
KB bytes.
Segmentation. One segment table entry per segment, 8 bytes each. The total number of segments is .
bytes.
Segmentation with paging. Each process has a segment table, and each segment has its own page table. A segment is at most 256 KB, so its page table has entries of 4 bytes bytes (1 KB). With 20 segments in all, the page tables take KB bytes. Add the segment tables:
bytes.
So bytes.
Answer: (B)
(195 pages), (254) and (45): 1 outer + 1 inner = 2 KB each.
(364 pages, more than 256): 1 outer + 2 inner = 3 KB.
KB bytes.
Segmentation. One segment table entry per segment, 8 bytes each. The total number of segments is .
bytes.
Segmentation with paging. Each process has a segment table, and each segment has its own page table. A segment is at most 256 KB, so its page table has entries of 4 bytes bytes (1 KB). With 20 segments in all, the page tables take KB bytes. Add the segment tables:
bytes.
So bytes.
Answer: (B)
In the working-set strategy, which of the following is done by the operating system to prevent thrashing?
I. It initiates another process if there are enough extra frames.
II. It selects a process to suspend if the sum of the sizes of the working-sets exceeds the total number of available frames.
I. It initiates another process if there are enough extra frames.
II. It selects a process to suspend if the sum of the sizes of the working-sets exceeds the total number of available frames.
Answer: (D)
Taken from Galvin: "If there are enough extra frames, another process can be started. If the sum of the working-set sizes grows and goes above the total number of available frames, the operating system picks a process to suspend. The pages of that process are written out (swapped), and its frames are given to other processes. The suspended process can be restarted later."
So the answer is Option (D).
A computer system supports 32-bit virtual addresses as well as 32-bit physical addresses, Since the virtual address space is of the same size as the physical address space, the operating system designers decide to get rid of the virtual entirely. Which one of the following is true?
Answer: (A)
Virtual memory gives a process three things: a larger address space, memory protection and relocation. Here the 32-bit virtual space is no bigger than the physical space, so the first one is not needed. But protection between users and relocation of programs are still needed.
Without virtual memory these two can be done only in software, or by splitting the memory into fixed parts among the users. Both ways are very inefficient. Each user then gets only a small share of memory, which also limits the number of users. So efficient multi-user support is no longer possible, which is (A).
(C) is wrong because protection and relocation still need hardware support (for example base and limit registers or an MMU).
(B) is wrong because cache efficiency depends on cache size, block size and mapping, which dropping virtual memory does not change.
(D) is wrong because CPU scheduling efficiency depends on the scheduling algorithm and the mix of processes, not on address translation.
Answer: (A)
Without virtual memory these two can be done only in software, or by splitting the memory into fixed parts among the users. Both ways are very inefficient. Each user then gets only a small share of memory, which also limits the number of users. So efficient multi-user support is no longer possible, which is (A).
(C) is wrong because protection and relocation still need hardware support (for example base and limit registers or an MMU).
(B) is wrong because cache efficiency depends on cache size, block size and mapping, which dropping virtual memory does not change.
(D) is wrong because CPU scheduling efficiency depends on the scheduling algorithm and the mix of processes, not on address translation.
Answer: (A)
Keep practising
Topics in Operating System
System CallProcessThreadProcess SynchronizationDeadlockCPU SchedulingDisk Scheduling
Memory ManagementYou are here
File Systems