Move the Windows Swap File

November 1, 2007 by
Filed under: PC Speed 

Every computer has a limited amount of internal memory, or RAM. Operating systems, like Windows NT, Windows 2000, Windows XP and Windows Vista overcome this memory limitation by using virtual memory. The concept is to swap memory from RAM to a hard disk file when more memory is needed.

This swapping of memory to hard disk will affect the computer performance. Although swapping memory will allow for a higher memory usage, the hard disk speed will affect the Windows performance. If your Windows PC is not performing like you expect it should, you can have a look at the page file configuration.

The first thing to do to ensure Windows is fast, is to use a fast hard disk. These days most systems support SATA drives, which are the fastest available at the moment. SCSI disks are an alternative, but they are more costly, so less common for personal computer usage. Another possibility is a RAID disk configuration, which can increase the hard disk transfer rate, but does require multiple disks and is much more complex. Only Raid level 0 can potentially help improve performance, since it improves the read speed. A requirement for RAID is also that it is hardware RAID and not software RAID, otherwise it will have a negative impact on overall performance.

The actual swap file that the Windows operating systems uses to swap memory, is a single file on disk. By default this swap file is created on the same disk as the windows installation. But there are better locations for the swap file. The best PC performance is achieved if the windows swap file is on a different hard disk from the operating system. The second best is to have the swap file on a separate partition of the hard disk. This would be most applicable for laptop computers as they only one hard disk.

In both cases it is actually good to leave a small pagefile on the system disk because Windows needs that to make a memory dump in case of errors.

To change the location of the swap file in Windows XP:

  1. From the Windows Start menu, select Control Panel.
  2. In the Control Panel select Performance and Maintenance and then click System.
  3. In the System Properties dialog box, select the Advanced tab.
  4. Next, click the Settings button in the Performance group.
  5. In the Performance Options dialog box, select the Advanced tab.
  6. Now click the Change button in the Virtual memory group.
  7. First create a new swap file on the drive you want to use for the swap file. Make sure you specify at least the same Initial size and Maximum size as the existing swap file on the Windows installation disk.
  8. Click OK three times to close all dialog boxes. You will need to restart your computer to have the changes take effect. After that the swap file will be on the new drive, and you should notice the better PC performance.
  9. Next, remove the swap file on the Windows installation disk by selecting the drive and then selecting the No paging file radio button.

If you have multiple hard disks in your system, you can actually consider adding swap files to increase performance. Make sure to configure the swap files on different physical hard disks in that case, and make the page files on the secondary hard disks larger than on the system disk.

If you want more than 4 GB of swap file size (the Windows limit), you actually need to use multiple swap files. But it is probably better to add more RAM to your system in that case as a swap file of that size will not help your system’s performance.

As with all performance tweaks, a lot depends on your usage of the system, so make sure you test various configurations to see what works best in your case.

Microsoft has an interesting article on pagefile configuration in Windows XP.

Comments

3 Comments on Move the Windows Swap File

  1. Stefan on Fri, 19th Mar 2010 8:31 am
  2. Thanks for this article. It was a great help for me :)

  3. Vanessa on Tue, 3rd Apr 2012 10:44 pm
  4. There is not a setting to change the location of the swap file in Windows XP.

  5. Anthony on Wed, 4th Apr 2012 1:41 pm
  6. @Vanessa – Don’t get your comment, the instructions are in the article. Try typing “sysdm.cpl” in the Start menu and open that if you cannot find the setting.

Tell me what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!

You must be logged in to post a comment.