Page Fault Frequency
What you'll learn: How operating systems dynamically adjust the number of frames allocated to a process by monitoring how often page faults occur.
The Core Problem
The Working Set Model gave us a theoretical way to know how much memory a process needs, but it's hard to implement perfectly. Page Fault Frequency (PFF) takes a more practical, feedback-driven approach: instead of predicting memory needs, we measure how a process is actually performing and adjust accordingly.
How Page Fault Frequency Works
PFF establishes two thresholds:
- Upper threshold: If page faults happen too frequently, the process doesn't have enough frames—it's thrashing. The OS allocates more frames to reduce faults.
- Lower threshold: If page faults are rare, the process has more memory than it needs. The OS can reclaim some frames for other processes.
Think of it like a thermostat: if the room gets too cold (too many faults), turn up the heat (add frames). If it's too hot (very few faults), reduce heating (take away frames).
The Algorithm in Action
- Monitor the rate of page faults for each process over time windows
- Compare the rate against upper and lower thresholds
- Above upper threshold? Allocate more frames to this process
- Below lower threshold? Remove frames from this process
- Can't allocate more frames? Suspend or swap out a process to free memory
This creates a dynamic equilibrium where each process gets roughly the memory it needs based on its current behavior, not predictions.
Why This Matters
PFF is simpler to implement than Working Set tracking because you only need to count faults—no complex time-window tracking of page references. It responds to actual problems (high fault rates) rather than trying to predict them.
Key Takeaway: Page Fault Frequency dynamically adjusts frame allocation by monitoring fault rates and adding frames when faults are too frequent or reclaiming them when faults are rare, creating a practical feedback-based memory management system.