What Is Virtual Memory?
"Virtual memory" refers to the use of hard disk space as if it were RAM (physical memory). As multitasking operating systems emerged, virtual memory became a necessity, especially on computers with lower amounts of physical memory. The file or files used as virtual memory are sometimes called 'swapfiles' or 'pagefiles.'
-
Origin
-
Before the advent of multitasking operating systems like Microsoft's Windows 95 and later, and Apple's Mac OS, computers typically had only one or two processes running at a time. Microsoft's MS-DOS system is a perfect example: Because the only process always running was "command.com" (the program that interprets the user's commands), MS-DOS's memory requirements were low. When multitasking operating systems emerged, the physical memory of most computers was not enough to hold all the data in use at one time, so some data had to be written to the hard disk. The resulting virtual memory files took up some space on the disk but allowed more programs to remain open, even with a low amount of RAM.
Methods
-
Virtual memory may be implemented in an operating system in a variety of ways. Most versions of Windows store virtual memory data in a single file called "pagefile.sys." Mac OS X, being an operating system based on UNIX, uses several files, named sequentially: "swapfile0," "swapfile1" and "swapfile2," for example.
-
Advantages
-
Virtual memory's greatest advantage, along with the reason it was invented, is that it allows more data to remain in use at one time than the computer's physical memory is capable of holding. This data can also be broken up and reorganized to maintain efficiency when it is not in use. Its use is dependent on the amount of data in use at one time, so virtual memory files do not take up unnecessary space on the disk.
Disadvantages
-
Virtual memory also has its drawbacks. Since the data is stored on the hard disk instead of in physical memory, the time it takes to access this data is slightly longer. As a result, the computer can be a bit slow when much virtual memory is in use. Additionally, when a lot of data is in use at one time, virtual memory files can grow somewhat large, leaving little free space for users with small hard disks.
Tips for Using Virtual Memory
-
Due to its drawbacks, it is best to only use virtual memory when really necessary. To this end, there are a number of things users can do to reduce the amount of virtual memory needed. One is to install more memory in the computer. Doing so provides more physical memory for programs and data that are in use. Users of Windows Vista have the option to use a USB drive plugged in to a USB port as additional physical memory. Since USB drives use flash memory instead of hard disks, there is no decrease in speed.
-