0
2.6kviews
What is virtual memory?
1 Answer
0
5views
  • Virtual memory, simply put is when the hard disk is used to provide an extension to main memory. In essence, virtual memory is a facility that allows programs to address memory from a logical point of view, without regard to the amount of main memory physically available.

  • When virtual memory is used, the address fields of machine instructions contain virtual addresses. For reads to and writes from main memory, a hardware memory management unit (MMU) translates each virtual address into a physical address in main memory. The advantage of using such a scheme is that it is possible for a process to be larger than all of main memory. One of the most fundamental restrictions in programming has been lifted.

  • The process of address translation is shown in Figure 2 which shows the Virtual Memory organization as well.

enter image description here

  • Without demand paging (this is the practice of getting pages from the secondary memory into the main memory as and when required. Programs are considered to be divided into fixed length/fixed size pages) and virtual memory, a programmer must be acutely aware of how much memory is available.

  • If the program being written is too large, the programmer must devise ways to structure the program into pieces that can be loaded one at a time. With virtual memory scheme and demand paging as specified above, that job is left to the OS and the hardware. As far as the programmer is concerned, he or she is dealing with a huge memory, the size associated with disk storage. Because a process executes only in main memory, that memory is referred to as real memory. But a programmer or user perceives a much larger memory—that which is allocated on the disk. This latter is therefore referred to as virtual memory.

  • Virtual memory allows for very effective multiprogramming and relieves the user of the unnecessarily tight constraints of main memory.

Please log in to add an answer.