Not enough swap space (Win-XP)

I got this message this morning. The hard drive has 80 GB free (out of 105) and that ought to be enough swap space for anything imaginable. It is XP, ver. 5.1, SP3.

Is your page file size manually set or controlled by Windows?

This (you should let Windows manage it as a general matter).

Also, if your drive is badly fragmented this can be an issue. The swap file needs contiguous disk space. Fragmentation can have it that the largest empty hole on your drive is relatively small. It can have a lot of such holes so you see a lot of free space but it is not contiguous.

Run Disk Defragmenter to fix this.

I’ve seen messages like that when the problem is actually a damaged pagefile, or that the page file is switched off.

Check the current settings in Control Panel>System>Advanced>(Performance)Settings>Advanced>Virtual memorym - click the ‘change’ button and make sure there is a page file setting

If that looks OK, try running ChkDsk to see if there’s a problem with the drive

In the case of this being a OS message I’d say the swap file is not set to let XP manage it.

In case you were running a graphics program they used to run their own swap space and pop up that message when it was too small for the picture manipulations you were preforming.

Windows doesn’t automatically use all of your free space. It sets aside a swap file of a certain size and uses that. If your programs try to allocate more memory than what it has set aside, you get that message. Your programs may also fail in their memory allocations until windows is done resizing its swap file.

It is possible that the swap file isn’t set to let windows manage it, as others said.

It is also possible that you are just running programs which use a lot of memory, and you are using more than windows expected you to. If you keep getting this message then maybe you want to stop letting windows manage the swap file and set it manually to a much larger value. You might also consider adding more RAM to the computer (note however that XP has a limit in the amount of RAM it can manage).

Another possibility is that you have a program with a memory leak. What this means is that the program allocates memory, but then due to a program bug it loses track of the memory and forgets to tell windows to free that chunk of memory up. The longer the program runs, the more and more memory it uses. In this case, making the swap file bigger or adding more RAM only makes it take a bit longer before you get the out of memory error. If you can’t get a patch to fix the program, what you may have to do is periodically save your work in this program and exit out of the program and restart it to free up all of the memory. If you go into the task manager you can look at all of your programs and see how much memory they are all using. If you see one that is constantly using more and more memory, it has a memory leak.

If the swap file is corrupt, you should be able to fix this pretty simply.
[li]Disable the virtual memory paging file. Windows bleat how this is a terrible thing. [/li][li]Reboot. Be patient - without a swap file, the PC will probably be slower. Be prepared to dismiss any errors about a missing page file.[/li][li]Run a disk defrag. (Should be under Accessories, System Tools)[/li][li]Return to virtual memory settings and re-enable the paging file. Select the option to have Windows manage it. [/li][li]Apply/OK your way out, and all should be well in your world.[/li][/ul]

If you want to be sure the file never gets fragmented again, you can specify the minimum and maximum size for the file - the old “rule of thumb” is to set it to be 1.5 to 2 times as big as the RAM in the PC. There is a bit of a performance hit if Windows has to keep changing the page file size, so I set mine this way - 2 GB of RAM gets a 4,000 MB page file since disk space is so cheap now.

Thanks for all the replies. I have never looked at the swap file and have certainly never either set it manually or set it to automatic. I was reluctant to reboot as I had a Firefox tab I wanted to save, but no more. I really ought to run defrag on general principles.