***Welcome to ashrafedu.blogspot.com * * * This website is maintained by ASHRAF***

Saturday, February 15, 2020

Virtual Memory


Virtual Memory

Virtual memory is a technique that allows the execution of processes that are not completely in memory. One major advantage of this scheme is that programs can be larger than physical memory.

Virtual memory technique frees programmers from the concern of memory storage limitations.

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 a fork( ) system call, eliminating the need to copy all of the pages of the original ( parent ) process.

The ability to load only the portions of processes that were actually needed ( and only when they were needed ) has several benefits:

  • Programs could be written for a much larger address space ( virtual memory space ) than physically exists on the computer.
  • Because each process is only using a fraction of their total address space, there is more memory left for other programs, improving CPU utilization and system throughput.
  • Less I/O is needed for swapping processes in and out of RAM, speeding things up.

Virtual memory involves the separation of logical memory as prescribed by users 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 address space of a process refers to the logical view of how a process is stored in memory. The actual physical layout is controlled by the process's page table.

A great hole in the middle of the address space is never used, unless the stack and/or the heap grow to fill the hole. Virtual address spaces that includes holes are known as Sparse address spaces.




No comments:

Post a Comment