Virtual Memory in Computer
Rajkumar Lama
August 21, 2019
Operating System
,
OS
,
Virtual Memory
,
Virtual memory in OS
,
what is virtual memory in computer
,
What is virtual memory?
virtual memory is a section of a hard disk that's set up to emulate the computer's RAM. |
Virtual Memory is a storage allocation scheme in which secondary memory can be addressed as thought it were part of main memory. Virtual memory is a memory management technique that is implemented using both hardware and software. It maps memory addresses used by a program, called virtual address, into physical addresses in computer memory. It gives an illusion to the programmer that programs which are larger in size than actual memory can be executed. Virtual memory can be implemented with demand paging.
The main visible advantage of this scheme is that programs can be larger than physical memory. Virtual memory serves two purposes. First, it allows us to extend the use of physical memory by using disk. Second, it allows us to have memory protection, because each virtual address is translated to a physical address.
Modern microprocessors intended for general-purpose unit, or MMU, is built into the hardware. The MMU's job is to translate virtual addresses into physical addresses.
Virtual memory also allows the sharing of files and memory by multiple processes with several benefits:
- System libraries can be shared by mapping them into the virtual address space of more than one process.
- Processes can also share virtual memory by mapping the same block of memory to more than one process.
- Process pages can be shared during fork() system call, eliminating the need to copy all of the page of the original (parent) process.