Virtual memory in Operating System is a technique that allows the execution of processes that may not be completely in memory. The only part of the program needs to be in memory for execution. It means that Logical address space can be much larger than physical address space. Virtual memory allows processes to easily share files and address spaces, and it provides an efficient mechanism for process creation.
Virtual memory is the separation of user logical memory from physical memory. This separation allows an extremely large virtual memory to be provided for programmers when only a smaller physical memory is available. Virtual memory makes the task of programming much easier because the programmer no longer needs to worry about the amount of physical memory available.
(Diagram showing virtual memory that is larger than physical memory)
Virtual memory can be implemented via:
- Demand paging
- Demand segmentation