Home | Projects | Notes > Operating Systems > Operating System Policies for Virtual Memory

Operating System Policies for Virtual Memory

 

Operating System Policies for Virtual Memory Overview

 

Fetch Policy

Demand Paging

Prepaging

 

Placement Policy

 

Replacement Policies

Basic Replacement Algorithms

Optimal

Least Recently Used (LRU)

First-In-First-Out (FIFO)

Clock

 

example-of-clock-policy-operation

 

Page Buffering (Frame Buffering)

 

Resident Set Management

Resident Set Size

Working Set Strategy

 

Cleaning Policy

Demand Cleaning

Precleaning

[!] Note: Page buffering applies here. A technique where the page to be swapped out is temporarily moved to a pending list that the OS maintains in main memory (subsequently, a free-frame will brought into memory to fill that spot). Then that frame can be quickly relinked into the resident set if it is referenced again, without writing out/reading back in from the swap space (secondary memory). Pages that are no longer to be referenced will eventually be rolled out of the list, but still this technique helps reduce disk I/O to a degree.

 

Load Control

 

Do Programmers Need to Understand Memory Management to Write Good Code?

Yes!

If our code has a high rate of data accesses, it could benefit from understanding page sizes and memory organization of our programs/languages.

e.g., Row-major vs. Column-major storage (Programming language level)

 

 

References

Stallings, W. (2018). Operating Systems: Internals and Design Principles (9th ed.). Pearson Education, Inc.