🎓 BookMCQ
← Back to 9. Virtual Memory

📝 Global versus local frames allocation (9 MCQs)

System-Wide and Process-Restricted Frame Replacement

Global and local frame allocation describe two different approaches to managing physical frames during page replacement. Under global allocation, a process can select a replacement victim from frames belonging to other processes. Under local allocation, it replaces pages only within its own assigned frame set. The policies determine how processes compete for physical memory and how independently their page-fault behaviour is managed.

Why Operating Systems Choose Different Replacement Boundaries

A global policy allows memory to move toward processes that currently need more frames, potentially improving overall utilisation. However, one process can remove useful pages belonging to another, making performance less predictable. Local allocation protects each process's frame allocation from outside competition, but may leave some frames underused while another process suffers excessive faults.

Victim Selection Across Global and Local Frame Pools

Under global replacement, a page fault can trigger selection from a system-wide eligible frame pool using a policy such as global LRU or an approximation. Under local replacement, the victim must belong to the faulting process. The kernel maintains the relevant allocation information, updates mappings, and reclaims the selected frame for the incoming page.

Two Processes Competing for Physical Frames

Suppose process P1 owns four frames and process P2 owns six. Under local replacement, a fault in P1 can evict only one of its four resident pages. Under global replacement, the victim may come from either process, including P2. This flexibility can help P1 but may increase P2's future page faults.

Allocation Flexibility and Performance Stability

Global replacement provides flexible resource redistribution and can improve utilisation when workloads have changing memory demands. Its disadvantage is interference between processes. Local replacement offers more predictable per-process behaviour but may reduce overall efficiency when frame allocations do not match working-set requirements. Operating systems may combine allocation policies with working-set or fault-frequency monitoring to manage these trade-offs.

Clarifying Process Ownership During Replacement

'Global replacement can select only the faulting process's frames' is incorrect because eligible system-wide frames may be selected. 'Local replacement allows a process to take another process's page' is incorrect because its victim set is restricted. 'Global replacement always improves every process's performance' is incorrect because stealing frames can increase another process's fault rate.

Exam Focus: Tracing Global and Local Victim Sets

Given several processes and their frame allocations, identify the valid victim set for each replacement policy. Trace how one process's fault can affect another process under global allocation. Compare predictable isolation with flexible frame utilisation. Questions may also examine how global replacement interacts with working-set size, process priorities, and system-wide memory pressure.

Key Terms of Global and Local Allocation

  • Global replacement - Selects from system-wide eligible frames.
  • Local replacement - Selects within one process allocation.
  • Victim set - Frames eligible for replacement.
  • Frame pool - Available physical frames.
  • Interference - One process affects another's memory.
  • Allocation boundary - Restriction on victim selection.
2
Easy
5
Medium
2
Hard

📝 All Global versus local frames allocation MCQs

Q1. Which statement correctly defines a global frame allocation policy in a demand‑paging operating system?

A.Free frames are shared among all processes, and any process may be assigned any free frame.
B.Each process has a fixed number of frames that never change.
C.Frames are allocated only to the operating system kernel.
D.Frames are allocated based on the size of the process's code segment. ✅
💡 Difficulty: easy | ✅ Correct: D

📖 Explanation: A global policy means that any free physical frame can be given to any process that needs it, which matches the first option. The second option describes a static local allocation and is therefore wrong. The third option limits frames to the kernel, which is not how user processes obtain memory. The fourth option ties allocation to code size, which is unrelated to the global sharing concept. This definition reflects how modern demand‑paging systems maximize utilization of available memory.

Q2. Why does a local frame allocation policy tend to isolate the impact of one process's memory‑intensity on other processes?

A.It limits the number of page faults each process can generate. ✅
B.Each process receives a predetermined set of frames, so one process cannot consume frames that belong to another.
C.It uses a single global page‑replacement algorithm.
D.It disables the valid‑invalid bit for all pages.
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: In a local policy each process is granted a fixed quota of frames, so if one process begins to demand many pages it can only use its own frames and cannot steal memory from its peers. Option A is incorrect because limiting page faults does not guarantee isolation. Option C describes a global replacement strategy, not isolation. Option D is unrelated to frame allocation. The isolation effect is why many systems use local quotas for fairness.

Q3. How does the valid‑invalid bit in a page table interact with global versus local allocation when a page is marked invalid?

A.In a global scheme, an invalid bit forces the OS to search all frames, while in a local scheme it only checks the owning process's frames.
B.The valid‑invalid bit works the same way regardless of allocation policy; it simply indicates whether the page is currently resident.
C.Under local allocation, an invalid bit automatically frees the frame for other processes, but not under global allocation. ✅
D.Global allocation disables the use of the valid‑invalid bit entirely.
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: The valid‑invalid (or present) bit merely signals whether a virtual page has a resident frame; this function is independent of how frames are allocated. Therefore the second statement is correct. The first option invents different search behaviors that do not exist. The third option suggests automatic sharing, which is not a function of the bit. The fourth option claims the bit is disabled under global allocation, which is false. Understanding this helps students see that page‑table metadata is consistent across allocation strategies.

Q4. What is the main trade‑off when choosing a global allocation policy over a local one in terms of page‑replacement decisions?

A.Global allocation eliminates page replacement entirely. ✅
B.Global allocation simplifies replacement because any free frame can be used, but it may increase contention between processes.
C.Local allocation always yields fewer page faults than global allocation.
D.Global allocation requires each process to maintain its own separate page table.
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: A global policy lets the OS pick any free frame, which makes the replacement algorithm simpler because it does not need to respect per‑process quotas. However, because all processes compete for the same pool, heavy memory users can crowd out others, creating contention. Option A is wrong because replacement is still required when memory is full. Option C overstates the benefit of local allocation; it does not guarantee fewer faults. Option D misstates the need for separate page tables, which is unrelated to allocation scope. Recognizing this trade‑off is key for system designers.

Q5. In a system that mixes both global and local allocation, which scenario most likely leads to starvation of a low‑priority process?

A.When the low‑priority process constantly accesses pages that are already in memory.
B.When high‑priority processes repeatedly cause page faults that occupy most of the free frames, leaving few frames for the low‑priority process.
C.When the low‑priority process has a larger code segment than high‑priority processes.
D.When the operating system disables swapping for the low‑priority process. ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: If high‑priority processes keep faulting, they will be given free frames under a global policy, gradually consuming the shared pool and leaving insufficient frames for the low‑priority process, which can then experience starvation. The first option describes a situation that would not cause starvation. The third option concerns code size, which does not directly affect frame availability. The fourth option would prevent swapping entirely, but the question assumes swapping is enabled. This scenario illustrates how mixed allocation can still suffer from priority‑induced resource imbalance.

Q6. A system has three processes P1, P2, and P3 with a total of 13 frames. Currently P1 occupies 5 frames, P2 occupies 4, and P3 occupies 3, leaving one free frame. Under a global allocation policy, a new page for P2 must be loaded. Which action minimizes additional page faults?

A.Assign the free frame to P2, increasing its resident pages to 5.
B.Steal a frame from P1, reducing P1 to 4 pages. ✅
C.Steal a frame from P3, reducing P3 to 2 pages.
D.Delay loading the page, causing a page fault.
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: With a global policy, the OS can simply use any free frame for the requesting process. Because one frame is already free, giving it to P2 avoids evicting any existing page and therefore prevents an extra fault. Option B and C would require replacing a page that is still needed, increasing faults. Option D deliberately postpones loading, which also generates a fault. This demonstrates the advantage of having a shared pool of frames in a global allocation scheme.

Q7. A process with a local allocation of 4 frames accesses pages in the order 1,2,3,4,5,1,2,3,4,5 using FIFO replacement. How many page faults occur?

A.4
B.5
C.8
D.10 ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: The first four distinct pages (1‑4) each cause a fault and fill the four frames. When page 5 is requested, FIFO evicts page 1, causing a fault. The next accesses of 1‑4 each find their pages missing because they were evicted, each incurring a fault. Finally, the second reference to page 5 hits the frame already loaded. Counting faults gives a total of ten, which matches the fourth option.

Q8. A system uses global allocation with 8 frames and the LRU replacement algorithm. Processes A and B each have pages A1‑A4 and B1‑B4. Initially the frames hold A1, A2, B1, B2, A3, B3, A4, B4. Process A then references A2, followed by process B referencing B5 (not resident). Which frames are evicted in order?

A.Evict A1, then B1.
B.Evict A4, then B4.
C.Evict A3, then B2.
D.Evict A1 (least recently used), then B1 (now least recently used after A2 reference). ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: After the initial state, the most recent use order places A2 as the most recently used. When A2 is accessed, A1 becomes the least recently used (LRU) and will be evicted for the new page B5. Once B5 occupies that frame, the next LRU among the remaining pages is B1, which is then evicted to make room for B5 if another fault occurs. Options A‑C propose incorrect eviction orders that do not follow LRU semantics. This scenario illustrates how LRU works across processes when frames are globally shared.

Q9. In a demand‑paging system with local allocation, each process receives exactly 2 frames. Process C currently has pages C1 and C2 resident. It now requests page C3. What must the operating system do?

A.Allocate a new frame from the global pool, expanding C's allocation. ✅
B.Replace one of the existing frames using a replacement algorithm, such as LRU.
C.Mark C3 as invalid and continue execution without loading it.
D.Terminate the process due to insufficient frames.
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Because the allocation is local and fixed at two frames, the OS cannot give C an extra frame. To satisfy the request, it must evict either C1 or C2 using a page‑replacement policy like LRU, then load C3 into the freed frame. Option A is impossible under strict local allocation. Option C would cause a fault when the process tries to use C3. Option D is unnecessary; the system can handle the request by replacement. This reflects how local quotas enforce replacement even when a process needs more pages.

🔗 Related Topics (MCQs)