Definition of the Swap File (or Virtual Memory)

Computers have a limited amount of physical RAM, which can only be increased by adding more memory chips to the motherboard. Luckily for us, engineers figured out a long time ago that we can use some space on our hard disks as if it were RAM.

If you’re using a Windows operating system, the space on the hard disk set aside to act like memory is called Virtual Memory. The use of the term Virtual Memory makes sense because the extra RAM isn’t actually there (hence, the virtual part). All other operating systems refer to the disk space as the swap file. The use of the term swap file also makes sense because data is swapped from one place to another: Data that isn’t currently being used is moved from the physcial RAM to the hard disk, and data on the hard disk that the processor needs is moved into RAM. For once in computing, both terms apply.

Just as the names for the swap file differ depending on what OS you use, so does the implementation. By default, Windows systems put a single file named pagefile.sys on the Windows installation root drive. The big disadvantage of this is that the pagefile.sys file can get very fragmented and since it’s on the same drive as the rest of Windows, it is very difficult to effectively defrag. On a Unix/Linux system, the swap file is a whole separate partition that is dedicated to the swap file. The swap file partition gets fragmented much less because it isn’t competing with disk space with the rest of the Operating System. Because of this separation, the Unix/Linux method is much more efficient.

Moving the Swap File on a Windows System

Fortunately, on a Windows system, you can make sure the pagefile.sys file lives on its own partiton just like a Unix system, even though Microsoft went through great lengths to hide the option to do so. In order for this to work, you must create a partition when you install Windows (or use a partitioning resizing program like Disk Commander). Once you have a separate partition, do the following:

  • Right-click on My Computer and choose Properties…
  • Click on the Advanced tab
  • Click the Settings button under the  Performance section of the dialog box
  •  Click on the Advanced tab on the resulting box
  • Click the Change button under the Virtual Memory section.
  • Click on the existing drive that has your pagefile on it. You’ll know which drive this is because it will have a paging file size listed next to it. Chances are, it will be C:
  • Choose the No Paging File radio button then click the Set button.
  • Now, click on the drive (partition) you wish to move your pagefile to.
  • Choose the System managed size radio button, then click the Set button
  • Click OK until you are prompted to reboot
  • Upon rebooting, your pagefile will be moved to the new drive (partition)

Note: If you put the pagefile.sys on a separate hard disk, you will notice a huge performance boost in applications like Photoshop that use a lot of Virtual Memory.

Leave a Reply

Your email address will not be published. Required fields are marked *