Saturday, February 26, 2011

Virtual Memory

Virtual memory is the common part of most operating systems on desktop computer.It had become so common because it provides a big benefit for users at a very low cost.

Most computers today have something like 32 or 64 megabytes of RAM available for the CPU to use. Unfortunately, that amount of RAM is not enough to run all of the programs that most users expect to run at once.

For example, if you load the operating system, an e-mail program, a Web browser and word processor into RAM simultaneously, 32 megabytes is not enough to hold it all. If there were no such thing as virtual memory, then once you filled up the available RAM your computer would have to say, "Sorry, you cannot load any more applications. Please close another application to load a new one." With virtual memory, what the computer can do is look at RAM for areas that have not been used recently and copy them onto the hard disk. This frees up space in RAM to load the new application.

Because this copying happens automatically, you not even know it is happening, and it makes your computer feel like is has unlimited RAM space even though it only has 32 megabytes. Because hard disk space is so much cheaper than RAM chips, it also has a nice economic benefit.

The read or write speed of a hard drive is much slower than RAM, and the technology of a hard drive is not geared toward accessing small pieces of data at a time. If your system has to rely too heavily on virtual memory, you will notice a significant performance drop. The key is to have enough RAM to handle everything you tend to work on simultaneously - then, the only time you feel the slowness of virtual memory is when there is a slight pause when you are changing tasks. When that is the case, virtual memory is perfect.

When it is not the case, the operating system has to constantly swap information back and forth between RAM and the hard disk. This is called thrashing, and it can make your computer feel incredibly slow.

The area of the hard disk that stores the RAM image is called a page file. It holds pages of RAM on the hard disk, and the operating system moves data back and forth between the pages file and RAM. On a Windows machine, page files have a .SWP extension.

                          

 



No comments:

Post a Comment