Saturday, November 15, 2008

No more virtual memory!

Virtual memory is exactly what it sounds like, fake memory. A simple example is, say you have 4 MB of memory and you want to run 5 programs each needing 1 MB of memory. When you run the 5th program the operating system takes 1 MB of memory that hasn't been used in a while and writes it to the hard drive. This frees up the memory allowing the 5th program to run. Now if another program requests the memory that is on disk, the operating system has to swap something with it. This is slow. For most users, the operating system manages it and you never have to think about it. Virtual memory is great and it's allowed people to multitask easier without having to worry about memory. But....

Memory is so incredibly cheap these days, I recently upgraded to 8GB of memory and turned off virtual memory. My thinking is before I had 4GB of memory and 4GB of virtual memory and my system ran great. Now that I have 8GB I shouldn't need any virtual memory. Why not have both? Windows is notorious of being a memory hog, the more there is, the more it uses. Disabling virtual memory is the only way to force windows and other programs to use only physical memory. Have you ever heard your hard drive spin up when switching programs? Not me anymore!


2 comments:

Diana said...

How cool!

lmiller7 said...

This article contains a number of errors. First of all, disabling the pagefile will NOT disable virtual memory. Windows operating systems are based on virtual memory and it cannot be disabled.

The pagefile is not merely a slow extension to physical memory, it is designed to optimize the use of whatever memory you have. It does this by temporarily storing rarely used data, thus making more memory available for more important uses.

Yes, Windows XP will use whatever memory is available. This is a good thing. Unused memory has no value whatsoever, it is the ultimate in wasted memory. XP will always try to find some use for as much memory as possible in an attempt to improve performance. This memory is not wasted. Windows has a complex and efficient system for reclaiming this memory when it is needed.

The author clearly has only a superficial understanding of virtual memory. Keep this in mind when condidering any advice he may give.

In most cases disabling the pagefile will impair performance. The large majority of those who truly understand virtual memory will agree.

Larry Miller
Microsoft MCSA