Number 228 - May 2002

Getting Rid of Junk in the Swap File
(Is This A Good Idea?)
by Bob Thomson
Fools Rush In
    You old timers will remember the WWII song "Fools Rush In Where Angels Fear To Tread!" The implication was that those who don't know any better do things that older and wiser folks, through experience, learned not to do. Well, I'm supposed to be one of the older and wiser ones in our user group but only the older part rang true the other day.

Zeroing The Swap File
    In the general Q&A discussion period at the April 2002 meeting Ray Mills happened to mention that your Swap File gets full of junk and can get quite large because, usually, it is sized automatically by Windows to handle whatever is needed--sometimes 'way more than is needed. An excessively large Swap File may slow down your computer operations. He suggested that the Swap File be cleared out every so often, particularly if you are going to defragment your hard drive, because the Swap File does not get cleared out automatically during a defrag operation.

    To clean out the Swap File, go to My Computer/Control Panel/System and click the Performance Tab. In the screen panel which is presented click on Virtual Memory button. You will now be presented with the choices to a) "Let windows determine the size of your Swap File", b) Set the size of your Swap File yourself, or c) Disable your Swap File. The advice Ray gave was to, temporarily, set your swap file to zero or disable it, and reboot your computer.

    When you try to do this, you will also be presented with a WARNING that you shouldn't do this since you may disable the ability of your computer to restart. "Pshaw!" said Ray, go ahead an do it because you are going to put it back to the default condition almost immediately.

    Upon Rebooting the swap file will be zeroed. Now go again to the My Computer/Control Panel/System area select the Performance Tab then Virtual Memory and click on the choice a) "Let Windows Determine the Size of your Swap File." Windows will then re-create the Swap File and assign the minimum size to it.

My Disaster and Recovery
    I hadn't really noticed any slow-down in my computer's operation, but I thought I would try out this procedure. Without thinking about it, I proceeded with the steps to disable the Swap File.
Unfortunately, I have some start-up programs which load while windows is loading (you probably do, too) and which REQUIRE the swap file be greater than zero or they won't work. Such a program is Norton Antivirus and, in fact, since it could not find a swap file it shut down my computer; that is it wouldn't let my computer start at all and posted a message to that effect followed by System Halted!--the condition to which the warning had referred.

    I was completely unprepared for this. It took me a good hour, maybe more, before I recovered enough of my sanity to get the machine to load Windows in SAFE MODE (which doesn't load the start-up programs) and go to My Computer/Control Panel/System area select the Performance Tab then Virtual Memory and click on the choice a) "Let Windows again Determine the Size of my Swap File." This command re-creates the Swap File upon reboot. Thus I was able to reboot with everything enabled and to use my computer again. Whew!

What Was Left Unsaid
    What SHOULD have been said at the beginning is this: "Before disabling it or setting the Virtual Memory to zero, first either run msconfig and disable the start up programs, or restart in SAFE MODE before rebooting with a zero swap file." Then the programs that require that the Swap File be present won't even try to start and interfere with the process. You can then proceed to safely zero out the Swap File, then restart and re-create a clean Swap File of minimum size.

Oh? Didn't I Mention That?
    When made aware of the problem I encountered when I zeroed the Swap File, Ray Mills commented that his computers are all set up to have no programs running when they start up. With no programs running in the background there is nothing that will try to access the Swap File and, not finding it, shut down his computers when they try to boot up. Consequently, he didn't think to mention it.

Did Resizing The Swap File Help?
    So far, since zeroing and resizing my Swap File, I have not noticed any difference in machine performance. If you decide to zero out your swap file, just keep the points discussed above in mind and take appropriate action. If you are satisfied with the speed with which your computer operates now, leave well-enough alone. Remember the old adage: If it ain't broke, don't fix it!
  Number 228 - May 2002