r/AskComputerScience • • May 14 '25
confused about virtual memory
If I got this right, the point of virtual memory is to ensure processes use unique physical address space.
Is this abstraction really needed ?
For example, say there are 2 C programs and each one does malloc. This asks the OS for memory. Why can't the OS guarantee that unique physical address space is given to the C program ?
2
Upvotes
View all comments
Show parent comment
1
u/Successful_Box_1007 May 16 '25
What do you mean by “it can find a page of memory from somewhere”? Where else besides the physical memory? I’m so confused.
But if it unmaps pages not being used - it must map them to something else right? Otherwise it’s lost. And if it is mapping it to something else - then overall how did we have a net “creation” of space?!