Virtual Memory
Clock policy, Page replacement algorithm
- virtual memory (due to many processes) can exceed the capacity of the physical memory
- use backing store as a mechanism to accomodate the limited memory resources
- backing store is usually taken from the hard disk and used for memory swapping
- when the requested page is not in the main memory it is considered a page fault
- there is a need for replacement when the main memory is full and does not have the requested page
the goal is to make the least number of replacements
how page replacement works
Page Replacement Algroithms
First-In-First-Out (FIFO) Algorithm
provided with a collection of pages that is needed by a process, and page frames that will store the pages
- if empty just insert the page
- if full, we replace the oldest one or the first one that went in the page frames
Optimal Algorithm
in FIFO we compared it to the previous page frame, here we try to predict the future despite receiving the page requests one by one
- replace the page frame that is used later than the others
- ex: replace 7 since 7 is used the later after 0 and 1
9 page faults
Least Recently Used (LRU) Algorithm
similar to FIFO by comparing to the previous page frame
- replace the page that is not used the longest or least recently used
Clock????
https://www.youtube.com/watch?v=gjLywr7GbLU&ab_channel=CS186Berkeley
https://youtu.be/E7pmf5pySTM?list=PLBXapj649rh9UKCBfJEyEUN5Ulvfq1s96&t=5993
Practice:
Answer:
- 2018-2
- Calculate the number of faults
Clock Policy
Hardware Control Structure
- Execution of Process
- Real and Virtual Memory
- O/S Policies for Virtual Memory
- Replacement Policy
https://youtu.be/yMRBWHWD39w?list=PLB2GiO0mMjw9J_OwnDMAqtsANzWsIylQz&t=4109
- UI
- book
- responsi
- zulfani
- exercises
- UI
- assignment
- responsi