Virtual memory and page replacement algorithms
50 min · Advanced
Virtual memory lets a process use more memory than is physically free by keeping only the pages it is using in RAM and the rest on disk. When a needed page is not in RAM, the OS loads it and, if RAM is full, chooses a page to throw out: that choice is page replacement, a favourite source of placement numericals.
Topics in this lesson
- Virtual memory, demand paging and page faults
- FIFO on a worked reference string, and Belady's anomaly
- Optimal and LRU on the same reference string
- Thrashing and the working set
- Counting page faults with exact answers
Interview questions this lesson answers
- What is virtual memory?
- What are the benefits of virtual memory?
- What is demand paging?
- What is a page fault?
- Is a page fault an error?
- What are the steps to handle a page fault?
- What is the valid-invalid bit?
- What is the dirty (modify) bit used for?
- How do you compute effective access time with page faults?
- Why must the page-fault rate be so low?
Sign in free to continue this lesson
Create a free account to read every lesson, practise with the exercises and keep track of your progress.