0
Challenge · 88CS Fundamentals

Virtual memory, paging and the URL question

OSused in ~85% of apps

Two questions, and the last two of the course. One is why your program can use more memory than the machine has. The other is what happens when you type a URL and press enter, which is asked so often that not having an answer is itself the signal.

Core idea. Virtual memory gives every process the illusion of its own large, contiguous address space, mapped in fixed-size pages onto whatever real memory is free, with the rest kept on disk. The URL question is the same kind of answer: a chain of named steps, told at the depth the interviewer asks for.
Playground, this isn't a screenshot
the same reference string, three policies
references: 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5
framesFIFOLRUoptimal
1121212
212129
39107
410 worse than above86
5555
Read the FIFO column downwards. Going from 3 frames to 4 makes it worse, which is Belady's anomaly and is not a mistake in the table. LRU never does this, because the pages it holds with one more frame are always a superset of what it held before.

More memory usually helps and, for FIFO, is not guaranteed to.

↑ play a little first, then dig in