Let's first understand what virtual memory is. Today. computers are used for a wide
variety of tasks. facilitated in part by modern ass providing multitasking capabilities. A multitasking as allows you to run more than one program at a time. If the number of programs you have started is greater than the number ofCPUs (processors) available and in use, the as repeatedly runs tiny parts of each program for very small amounts of time (not noticeable by the user) by turn; that is. it repeatedly allows each program to use the available CPU(s) for tiny fractions of a second. This creates the illusion of all programs running in parallel.

Multitasking. however. places large demands on the system memory (RAM). Running several graphical programs simultaneously can easily exhaust even today's large memory banks in a short while. To alleviate this problem. modern ass move some unused program ~ata from RAM onto the hard disk to make room for required data.
This can be done because all of a program's data in RAM is not needed at all times.

Name:  Improve Multi-OS computer performance.jpg
Views: 38
Size:  37.5 KB

If a program has finished working with some data and needs other data that had earlier been moved out to the hard disk, the as can again move out the used data and move the old data back in. This entire process of moving unneeded data out and required data in is called swapping or paging. and the area on the hard disk where data is moved out from the RAM is called the swap space. page file. or virtual memory. VIrtual memory is used even if you do not run more than one program at a time. simply because it allows the OSto keep frequently used parts of the running program in memory (as well as parts of the as itself).

It is always better to assign a dedicated partition on a hard disk to the virtual memory. Since hard disks are much slower than RAM, it takes a Significant amount of tirr,c to move data to and from virtual memory. Having a separate partition causes reading and writing of virtual memory to be independent of the reading and writing of other files. We will see how this scheme can be improved further.