Definition
Fetch Policy
A fetch policy determines when a page should be brought into main memory (RAM) from secondary storage.
Strategies
Demand Paging
A page is brought into memory only when a reference is made to a location on that page.
- Pros: Only the required pages occupy memory.
- Cons: High number of page faults when a process first starts or moves to a new execution phase.
Prepaging
Pages other than the one requested are brought into memory in advance.
- Logic: Based on the principle of locality—if page is requested, page is likely to be needed soon.
- Pros: Can significantly reduce page faults if the locality assumption holds.
- Cons: If the pre-fetched pages are never used, I/O bandwidth and memory space are wasted.
Comparison
Modern operating systems primarily use demand paging due to its accuracy, often combined with small-scale preparing (e.g., reading a few adjacent pages) when a disk read occurs to improve efficiency.