chapter 21 - beyond physical memory Flashcards
What assumption breaks down when memory fills up?
That all pages can fit in physical memory
What is the solution when memory is full?
Use disk as swap space to temporarily hold unused memory pages
What is swap space?
Disk space used to store inactive pages when memory is full
What happens when a page is swapped out?
It’s removed from RAM and written to swap space on disk
What does the present bit in a PTE indicate?
1: Page is in RAM
0: Page is not in RAM → triggers a page fault
What is a page fault?
When a page is accessed but not in memory, the OS loads it from disk
What does the OS do on a page fault?
Finds free frame
Loads page from disk
Updates PTE
Retries the instruction
What if no free RAM is available during a page fault?
A victim page must be evicted to make space
What is a page-replacement policy?
The algorithm the OS uses to choose a page to evict
Why not wait until RAM is completely full?
It delays page fault handling
What is the high watermark?
Amount of free pages the system tries to maintain after evictions
What is the swap daemon?
A background thread that proactively frees pages to keep RAM available
Why evict pages in clusters?
To reduce disk seek/rotation overhead and speed up I/O
What are the steps for a memory access with paging & swapping?
TLB lookup
If miss → Page table lookup
If present → update TLB
If not present → Page fault
Load from disk
Retry access
Does the process know the memory managment?
No. The OS + hardware handle all paging/swapping transparently.