Your computer runs more programs than can fit in RAM at once. The operating system creates an illusion of unlimited memory through virtual memory: it keeps pages of data on disk and loads them into physical RAM only when needed.
When a program touches a page that is not in RAM, a page fault occurs. The OS pauses the program, fetches the page from disk — which can take thousands of times longer than a RAM access — and then resumes. If RAM is already full, it must first evict one of the existing pages to make room.
Which page should it evict? Evict the wrong one and the processor stalls again moments later fetching it back. Evict the right one and the program barely notices. That choice is the page replacement problem, and the gap between a clever policy and a careless one is the difference between a snappy system and one that thrashes.
Comments
Loading comments...