Building a click-and-watch simulation: click on file pages, and watch them get pulled into RAM one at a time, with a free-frame limit so eviction kicks in too.
Try clicking on below simulation.
What to try:
- Click pages
0,1,2— each one is a fresh page fault, since RAM is empty at first. Watch them fly into the empty frames. - Click page
0again — it's a hit now. No disk read, no fault counter increase. - Click pages
3, then4— RAM only has 4 frames, so once it's full, the oldest unused page gets evicted to make room. That's the "OS decides what stays resident" idea from before, happening live.
That eviction step is the part your program never sees or controls. It just keeps touching memory addresses — the OS quietly swaps pages in and out behind the scenes, same as the librarian fetching books and clearing your desk when it gets crowded.
Interactive simulation: click pages of a file on disk to load them into RAM through page faults, with eviction once RAM fills up
Disk file — 8 pages. Click a page to access it.
RAM page cache — only 4 frames available


