Friday, December 15, 2006

Windows XP: Swap File (Virtual Memory) - Part 1

Do you know about the swap (or paging) file, and what it's used for? Every version of Windows since version 3.1 has included the Virtual Memory (VM) feature. VM is a pseudo-type memory that computer can use when it runs out of physical RAM.

The way the VM feature works is by moving non-critical chunks of data out of the computer's RAM, and on to the hard drive thus free up memory for other things. This process known as 'swapping' or 'paging'.

The benefit of VM is that it gives you more memory to run your applications if you don't have enough physical RAM. The problem is that in order to get the extra memory, VM has to store the data from the faster RAM on to the slower local hard drive.

All hard drives are much slower then real physical RAM. So when the system requests a chunk of memory from VM, the computer has wait for data to come from the hard drive. This will make your seem much slower then it actually is.

When the VM data is written to disk, its stored in a file called C:\PAGEFILE.SYS. This file is generally x1.25 to x1.5 the size of your RAM. So if you have 1GB of RAM, the swap file will consume about 1.25 to 1.5GB of hard drive.

Over the next few days we will discuss options for managing and optimizing virtual memory.

No comments: