Anonymous user menu

Demand Paging | Advantages of virtual memory | Disadvantages of virtual memory

DEMAND PAGING:

What actually the demand paging is process of loading page or program into main memory whenever asked or demand is known as demand paging.

Observe clearly how the demand paging works:

  • Suppose CPU needs a page that is not in the main memory, it may generate abort or interrupt.
  • Moving execution further operating system will bring the demand page into the memory
  • Demand page will have brought from logical address to physical address space, then the page will be replaced one of the existing page their we have use page replacement algorithms.
  • After the getting information to CPU it will continue the program execution and the process will be back with ready state.

In this scenario, whenever the page fault occurs these are the necessary steps followed by operating systems to bring page into main memory.

 

Advantages of virtual memory:

  • Firstly, the main advantage of virtual memory is the size of program can be more than the size of main memory.
  • We can use memory efficiently because only partial program will have loaded into main memory
  • And, it allows us to perform multiprogramming.

Disadvantages of virtual memory:

  • Crucial thing is page size.
  • Paging interrupts.
  • And the hardware cost is also main disadvantage.

Example:

Mainly the virtual memory is used to translate virtual addresses to physical addresses when the system has some parameters.

For example:

Observe clearly,

  1. virtual address:

  2. Address translation:

  3. Physical Address:

Now you can clearly understand how virtual address is translated into physical address, virtual address is more than physical address then the virtual memory is more useful.

To understand more clearly 25MB program can be run in 5MB space by keeping 5MB to keep in memory each instance.

 

Conclusion:
Finally, the virtual memory is nothing but the separation of user logical memory from physical memory. In this method we keep only part of program in the memory and the other remaining part on the disk that is secondary storage. Every user feels the execution smooth because of virtual memory they may think that program is running in a large space, but actual scenario is it is running on limited amount of space.

0Comment

What to read next

Please Go through all these linksW3Schools – HTML Tutorial

DefinitionFiber optics is the technology used to transmit information as pulses of light through strands of fiber made of glass or plastic over long