No matter how much main memory your system boasts,
Windows XP still creates and uses a page file for virtual memory. To
maximize page file performance, you should make sure that Windows XP is
working with the page file optimally. The next few sections present some
techniques that help you do just that.
Storing the Page File Optimally
The location of the page file can have a major impact on its performance. There are three things you should consider:
Store the page file on the hard disk that has the fastest access time—
You’ll see later in this section that you can tell Windows XP which
hard disk to use for the page file. If you have multiple hard disks (not
just multiple partitions of a single disk), you should store the page
file on the disk that has the fastest access time.
Store the page file on an uncompressed partition—
Windows XP is happy to store the page file on a compressed NTFS
partition. However, as with all file operations on a compressed
partition, the performance of page file operations suffers because of
the compression and decompression required. Therefore, you should store
the page file on an uncompressed partition.
Store the page file on the hard disk that has the most free space—
Windows XP expands and contracts the page file dynamically depending on
the system’s needs. To give Windows XP the most flexibility, make sure
that the page file resides on a hard disk that has a lot of free space.
Splitting the Page File
If you have two or more
physical drives (not just two or more partitions on a single physical
drive), splitting the page file over each drive can improve performance
because it means Windows XP can extract data from each drive’s page file
simultaneously. For example, if your current initial page file size is
384MB, you’d set up a page file on a drive with a 192MB initial size,
and another page file on a second drive with a 192MB initial size.
Customizing the Page File Size
By default, Windows XP
sets the initial size of the page file to 1.5 times the amount of RAM in
your system, and it sets the maximum size of the page file to 3 times
the amount of RAM. For example, on a system with 256MB RAM, the page
file’s initial size will be 384MB and its maximum size will be 768MB.
The default values work well on most systems, but you might want to
customize these sizes to suit your own configuration. Here are some
notes about custom page file sizes:
The less RAM you
have, the more likely it is that Windows XP will use the page file, so
the Windows XP default page file sizes make sense. If your computer has
less than 512MB RAM, you should leave the page file sizes as is.
The
more RAM you have, the less likely it is that Windows XP will use the
page file. Therefore, the default initial page file size is too large
and the disk space reserved by Windows XP is wasted. On systems with
512MB RAM or more, you should set the initial page file size to half the
RAM size, while leaving the maximum size at three times RAM, just in
case.
If disk space is
at a premium and you can’t move the page file to a drive with more free
space, set the initial page file size to 2MB (the minimum size
supported by Windows XP). This should eventually result in the smallest
possible page file, but you’ll see a bit of a performance drop because
Windows XP will often have to dynamically increase the size of the page
file as you work with your programs.
You
might think that setting the initial size and the maximum size to the
same (relatively large; say, two or three times RAM) value would improve
performance because it would mean that Windows XP would never resize
the page file. In practice, however, it has been shown that this trick
does not improve performance, and in some cases can actually decrease performance.
If
you have a large amount of RAM (at least 1GB), you might think that
Windows XP would never need virtual memory, so that it would be okay to
turn off the page file. This won’t work, however, because Windows XP
needs the page file anyway, and some programs might crash if no virtual
memory is present.
Watching the Page File Size
Monitor the page file performance to get a feel for how it works under normal conditions, where normal means while running your usual collection of applications and your usual number of open windows and documents.
Start
up all the programs you normally use (and perhaps a few extra, for good
measure) and then watch System Monitor’s Process\Page File Bytes and
Process\Page File Bytes Peak counters.
Changing the Paging File’s Location and Size
The page file is named Pagefile.sys and it’s stored in the root folder of the %SystemDrive%. Here’s how to change the hard disk that Windows XP uses to store the page file as well as the page file sizes:
1. | If necessary, defragment the hard disk that you’ll be using for the page file.
|
2. | Launch Control Panel’s System icon to display the System Properties dialog box.
|
3. | In the Advanced tab’s Performance group, click Settings to display the Performance Options dialog box.
|
4. | In the Advanced tab’s Virtual Memory group, click Change. Windows XP displays the Virtual Memory dialog box, shown in Figure 1.
|
5. | Use the Drive list to select the hard drive you want to use.
|
6. | Select a page file size option:
Custom Size | Activate
this option to set your own page file sizes using the Initial Size (MB)
and Maximum Size (MB) text boxes. Ensure that Windows XP is able to
dynamically resize the page file as needed by entering a maximum size
that’s larger than the initial size. | System Managed Size | Activate this option to let Windows XP manage the page file sizes for you. | No Paging File | Activate this option to disable the page file on the selected drive. |
Tip
If you want to move the
page file to another drive, first select the original drive and then
activate the No Paging File option to remove the page file from that
drive. Select the other drive and choose either Custom Size or System
Managed Size to add a new page file to that drive.
Tip
If you want to split
the page file over a second drive, leave the original drive as is,
select the second drive, and choose either Custom Size or System Managed
Size to create a second page file on that drive.
|
7. | Click Set.
|
Exit all the dialog
boxes. If you changed the drive or if you decreased either the initial
size or the maximum size, you need to restart your computer to put the
changes into effect.
Defragmenting the Page File
As Windows XP
dynamically sizes the page file, it’s possible that it can become
fragmented, resulting in a small performance hit. Windows XP manipulates
the page file in relatively large blocks, so fragmentation rarely
occurs. However, if you’re looking to eke out every last drop of
performance on your machine, you should probably ensure that the page
file is defragmented.
Tip
To determine whether the
page file is defragmented, run Disk Defragmenter and analyze the
partition that contains the page file. View the analysis report and, in
the Volume Information list, find the Pagefile Fragmentation item. The
Total Fragments value tells you the number of fragments used by the page
file.
Unfortunately, Windows XP Disk Defragmenter tool does not
defragment the page file. To accomplish this, you have to temporarily
move or disable the page file. Here are the steps to follow:
1. | Display the Virtual Memory dialog box as described in the previous section.
|
2. | You have two ways to proceed:
If
you have a second hard drive on your system, first set up a page file
on the other hard drive using the same initial and maximum values of the
original page file. Then select the original drive and reduce the
initial and maximum sizes to 0 for the page file. If you have only one hard drive, activate No Paging File to disable the page file.
|
3. | Restart your computer.
|
4. | Defragment the hard drive that contained the original page file.
|
5. | Display the Virtual Memory dialog box and restore the original page file settings.
|
6. | Restart your computer.
|