11. Local vs. Global Allocation Policies

Tanenbaum Section 3.5.1 (Fig. 3-22): Process-local replacement quotas versus system-wide global frame allocation under memory pressure.

1. The Core Allocation Dilemma in Multiprogramming

When multiple processes run concurrently in a virtual memory operating system, physical RAM must be divided among them. If a running process suffers a page fault and all physical frames are occupied, the kernel must select a resident page to evict. The foundational policy question is: Should the victim be chosen exclusively from the faulting process's own allocated frames, or from any frame in the entire machine?

2. Local Allocation Policies

A local replacement policy assigns each active process a fixed quota of physical page frames (e.g., determined at process startup based on executable size or dynamic working set estimation). When a page fault occurs, the kernel chooses a replacement victim strictly from the pages owned by that specific process.

  • Pros (Isolation): Processes are isolated from one another. A poorly written, thrashing program cannot steal frames from other well-behaved applications.
  • Cons (Inflexibility): If a process enters a heavy compute phase requiring more memory, it cannot borrow idle frames from an inactive process, leading to artificial page faults and suboptimal performance.

3. Global Allocation Policies

A global replacement policy treats all physical memory frames in the machine as a unified, shared pool. When any process incurs a page fault, the kernel selects a replacement victim from the entire system-wide population of resident pages, regardless of which process owns them.

  • Pros (Adaptability): Highly efficient. If Process A is idle, its resident frames naturally migrate to Process B if B's working set is expanding. Overall system throughput is maximized.
  • Cons (Vulnerability): Lack of isolation. A runaway or thrashing program can continuously steal frames from other processes, dragging down system-wide responsiveness.
Figure 3-22: Local vs. Global Page Replacement (Tanenbaum) (a) Original Configuration Process A (5 Frames) Process B (5 Frames) (b) Local Replacement Process A faults: Evicts only from A's quota Process B unaffected Quotas remain strictly 5/5 (c) Global Replacement Process A faults: Can steal frame from B! Dynamic Quotas: A grows (6), B shrinks (4)
Step 1 of 4 Guided Walkthrough: Allocation Mechanics
1. The Baseline Multiprogramming State
Live Step Schematic Physical RAM Pool (8 Total Frames) Process A Quota Frames [0, 1, 2, 3] F0 F1 F2 F3 Isolation Boundary Process B Quota Frames [4, 5, 6, 7] F4 F5 F6 F7

Part 3: Interactive Multi-Process Allocation Sandbox

Trigger page faults for Process A or Process B under Local vs. Global allocation policies and observe frame ownership.

How the Sandbox Works & What to Observe:
1. Select Policy Mode Choose Local Allocation to keep quotas strictly fixed at 4/4, or Global Allocation to allow cross-process frame stealing.
2. Trigger Faults Click Fault Process A or Fault Process B to simulate a page fault. Watch the SVG system memory map update instantly.
3. Observe Frame Stealing vs. Isolation Under Local mode, notice how faults stay strictly contained within each process's quota. Under Global mode, faulting Process A seizes frames from Process B with a red visual tracking vector!
Live System Memory Map (8 Frames) FRAME STOLEN ACROSS PROCESSES! LOCAL POLICY: Quota isolated. Other process protected!
Active Policy: Local Allocation Process A Frames: 4 Process B Frames: 4
Physical RAM Frames Grid
Kernel Allocation Event Log