Bloomberg LP Interview Question
Software Engineer / DevelopersVM is necessary for the following:
1. Flat memory model - Even though the system has a hierarchial model VM provides a flat memory model which makes programming a lot more easier.
2. Address space protection - Since VM is specific to a process, the processes are seperated out into different address domains because of VM. So one messy process would not crash another.
3. Reserve address locations - For instance the ability to always have the heap at a particular address or for that matter load code at a particular block is not possible without VM since many programs would need to be loaded into the same address locations. Without the logical VM abstraction the physical memory would not be able to cope up with such demands.
The advantage of virtual memory is that it allows a computer to multiplex its CPU and memory between multiple programs without the need to perform expensive copying of the programs' memory images. If the combination of virtual memory system and operating system supports swapping, then the computer may be able to run simultaneously programs whose total size exceeds the available physical memory.
- Vijay July 03, 2006