0
$\begingroup$

I'm studying for my operating systems final, and one question that my professor asked that I can't seem to find the answer to is the following:

"Why does virtual memory use non-contiguous memory allocation?"

The textbook only talks about virtual memory in the context of non-contiguous memory allocation, but never explains why. The only reason I can think of is because of page replacement, but I'm not even sure that's right. Anyone have any thoughts on this?

$\endgroup$
0
$\begingroup$

Your professor asked you a tricky question. The answer is - by definition.

The virtual memory is a mechanism to map non-contiguous physical memory to contiguous logical memory (for each running process). Why does the free physical memory become non-contiguous? Well, processes start and stop in unpredictable order, so the memory of stopped processes ought to be reused.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.