Virtual Memory


What is virtual memory?


1. Memory management scheme that allows execution of processes that might not be completely loaded in the main memory.

2. It does not require the entire process to be in memory before the process can execute


Virtual Memory Realization


Three basic concepts used for its realization are:

§ On-line secondary storage: Used to keep a process’s addressspace ready to be loaded into the memory.

§ Swapping: Process of transferring a block of data fromthe on-line secondary storage to main memory (swapping in) or vice-versa (swapping out).

§ Demand paging: Scheme of swapping in of pages of aprocess as and when needed during execution of the process, rather than loading all the pages beforestarting the process’s execution.


Advantages of Virtual Memory


§ Provides a large virtual memory to programmers on a system having smaller physical memory.

§ Enables execution of a process on a system whose mainmemory size is less than the total memory required by thep process.

§ Enables a process’s execution to be started even whens sufficientfree memory for loading the entire process is not available.

§ Makes programming easier there no longer need to worry aboutthe memory size limitations,

§ Often leads to less I/O activity resulting in bettert throughput turnaround time, and response time.


Disadvantages of Virtual Memory


§ Difficult to implement because it requires algorithms to supportdemand paging.

§ If used carelessly, it may substantially decrease performancedue to high page fault rate.