Okay, class, today we’re going to talk about virtual memory. I’ve chosen this topic because there are quite a number of inaccuracies in common circulation. Here are a few false beliefs about virtual memory.
All of these are false!!!!
I’m going to give you a brief overview of Virtual Memory, destroy these myths, and give you some good advice about how to manage it. So let’s begin.
Virtual Memory is Windows’ name for a swap file. It allocates a portion of your hard drive space for use by your system RAM. As programs run on your PC they load instructions into RAM. These instructions are then passed to the processor. The more active programs are running, the more RAM your system requires. Very often this amount is more than your physical RAM has available so some of the information is unloaded to the page file.
Windows makes an effort to keep memory full at all times. So often programs that have been closed still reside in memory. This is by design. That’s why the use of RAM cleaner programs will typically decrease system performance rather than improving it. When programs are unloaded to the page file, the oldest least used ones go first. When you’re running enough programs that active ones are moved to the page file, this is when your computer bogs down. It slows down because the swap file is only as fast as your drive seek speed and your IDE transfer which are much slower than the FSB transfer speed that your RAM uses.
The NT kernel is designed to use virtual memory. Period. Never eliminate the page file by setting your virtual memory to zero. You only hurt your performance. So the big question now is:
How much virtual memory do you need?
The answer is – that depends on what you’re doing. At minimum, you want to have the amount of physical RAM plus about 512MB. Having too little forces your system to completely unload information it needs just to have to load it into memory again later, and having too much forces your computer to attempt to fill it pointlessly. That’s why there can’t be a rule of thumb on how much you need. It’s different for every system and every user.
You want to have a dynamic page file that way it only contains useful information. However, if your system is forced to resize it too much, this makes the process take longer. So we need to determine the happy medium. How can we do that? Well, we need to determine what kind of memory usage we’re using. We can do this using the Performance tab in the Windows Task Manager. This shows all of the memory statistics for the current session (since your last reboot). There are a couple of key numbers in this display.
Physical Memory Total – The amount of physical RAM installed on your machine.
Kernel Memory Paged – The current size of your page file.
Commit Charge Peak – The total (phys + virt) peak amount of memory used this session.
With these numbers we can make a pretty good determination of your memory needs. The first step is to determine the minimal amount. You do this by checking your usage immediately after a reboot. If your peak is less than your installed RAM, then set your minimum to your installed RAM + 512MB. Otherwise, set it to a number just below the peak amount.
Then open as many applications as you would commonly run simultaneously. Internet browser, email client, office program, whatever a common “heavy” system load would be. Then check your peak again. Set your upper limit to about 512MB above this number.
This should make your page file stay at it’s smallest size while always remaining full. This is your optimum set up. You may find the need to tweak the upper limit a bit after you run your system for a while. Different combinations of running programs will change your requirements.
Creating a dedicated partition for your page file will also improve its performance dramatically. Likewise, if you frequently access multiple drives, creating a separate page file on each drive will also improve overall performance.
Emptying the page file at shutdown is a good idea if you don’t mind the additional time it takes to do so. This ensures that your system is only filling the page file with information pertinant to the current session. However, emptying it during a session will decrease performance since Windows will stop and take the time to fill it up again.
Hope these tips helped clear up a few misunderstandings. For most users, simply letting Windows manager your page file is enough, but for those of you who like to tweak out the last drop of performance from your system, this should put you well on your way.
Stop by these links for more valuable information: