In virtual memory systems, what is the difference between local page replacement and global page replacement policies?

Difficulty: Medium

Correct Answer: Local page replacement chooses victim frames only from the set of frames allocated to the faulting process, while global page replacement can choose a victim frame from the entire set of frames in memory belonging to any process

Explanation:


Introduction / Context:
Virtual memory systems use page replacement algorithms to decide which page to remove from physical memory when a page fault occurs and no free frames are available. A key design choice is whether the page replacement policy operates locally within each process or globally across all processes. This distinction affects fairness, performance isolation, and how the system reacts under heavy load.


Given Data / Assumptions:

  • Multiple processes are running and share the available physical frames.
  • Each process may be assigned a certain number of page frames.
  • On a page fault, the operating system must select a victim page to evict from memory.


Concept / Approach:
In local page replacement, each process has its own allocated set of page frames. When that process incurs a page fault and there are no free frames, the replacement algorithm must choose a victim page from the frames already allocated to that same process. Other processes and their frames are not affected directly. This can provide better isolation, because one thrashing process cannot steal frames from others. In global page replacement, the operating system treats all frames as a common pool. On a page fault, the victim page can belong to any process. This allows the system to adapt dynamically, giving more frames to processes that use them efficiently, but it can also allow some processes to starve others of memory and lead to interactions that are harder to control.


Step-by-Step Solution:
Step 1: Define local page replacement as choosing victims only from the page frames assigned to the faulting process.Step 2: Define global page replacement as choosing victims from the entire set of frames in memory, regardless of which process currently owns them.Step 3: Recognize that this choice is independent of single user versus multi user distinction.Step 4: Note that both policies can be applied to paged systems; the terms are not tied to segmentation versus paging.Step 5: Select the option that correctly describes local and global policies in terms of where victims can be chosen from.


Verification / Alternative check:
Operating systems textbooks often illustrate working set models and frame allocation strategies. In fixed allocation with local replacement, each process receives a fixed number of frames, and page faults within that process affect only its own frames. In variable allocation with global replacement, the system uses algorithms such as global least recently used, where any page in memory may be evicted. Examples and diagrams make clear that the major distinction is whether replacement is constrained to a process or not.


Why Other Options Are Wrong:
Option B: Connects local and global policies with single user and multi user systems, which is not part of the definition. Both policies can be implemented in either environment.Option C: Claims that local is only for paging and global for segmentation, which is incorrect. Both are discussed within the context of paging based virtual memory.Option D: Confuses primary and secondary storage and does not accurately describe any standard page replacement policy.


Common Pitfalls:
Students sometimes think that global replacement is always better because it offers more flexibility. However, it can cause interference between processes and lead to unfair behavior. Conversely, local replacement can protect processes from each other but may underutilize memory if a process does not use all of its allocated frames efficiently. Understanding this trade off is important when comparing different operating system designs.


Final Answer:
The correct answer is Local page replacement chooses victim frames only from the set of frames allocated to the faulting process, while global page replacement can choose a victim frame from the entire set of frames in memory belonging to any process.

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion