Advertisement

Optimize Virtual Memory for Performance in Windows XP:

This should only be done as a last resort. A far better option would be to install more memory or check for and remove any malware found on the system.

Your computer can address memory beyond what is physically installed on the system. This non-physical memory is called virtual memory, and it is implemented by using a piece of your hard disk that's set up to emulate physical memory. This hard disk storage is actually a single file called a page file, sometimes called a paging file or a swap file. When physical memory is full, Windows XP makes room for new data either program code or document contents by taking some infrequently-used data that's currently in memory and swapping it out to the page file.

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. In this column, I'll give you some tips on working with the page file and customizing its size for optimal performance. For more information on working with Windows XP performance options, see How to Set Performance Options in Windows XP.

Work with the Page File:

The page file is named Pagefile.sys and it's stored in the root folder of the drive on which Windows XP is installed. However, you don't work with this file directly. Instead, you'll move the file and customize its size by using options in the Virtual Memory dialog box. I show you how this is done later (see "Change the Paging File's Location and Size"), but here's a general look at techniques that help you customize the page file for best performance:

  • Store the page file on the hard disk that has the fastest access time. You will 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 hard disk. Windows XP is happy to store the page file on a compressed hard disk. However, as with all file operations on a compressed disk, the performance of page file operations suffers thanks to the compression and decompression required.
  • 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 system needs. To give Windows XP the most flexibility, make sure the page file resides on a hard disk that has a lot of free space.
  • Split the page file over two or more physical drives. 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 384 MB, then you'd set up a page file on drive with a 192-MB initial size, and another page file on a second drive with a 192-MB initial size.
  • Watch the page file size. Start all the programs you normally use (and perhaps a few extra, for good measure) and then watch the System Monitor Process\Page File Bytes and Process\Page File Bytes Peak counters.
  • To start the System Monitor, click Start, and then click Run. In the Run box, type perfmon.msc and click OK. In the Performance snap-in, you add counters by clicking the Add button or by pressing Ctrl+I.

Customize 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 three times the amount of RAM. For example, on a system with 256 MB of RAM, the page file's initial size will be 384 MB and its maximum size will be 768 MB. The default values work well on most systems, but you may 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 512 MB of 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 512 MB of 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 2 MB (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 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 since 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 1 GB), you might think that Windows XP would never need virtual memory, so that it would be okay to turn off the page file. This will not work, however, because Windows XP needs the page file anyway and some programs may crash if no virtual memory is present.

Change the Paging File's Location and Size:

If necessary, defragment the hard disk that you'll be using for the page file. Then follow these steps to change the hard disk that Windows XP uses to store the page file as well as the page file sizes:

  1. In Control Panel, click Performance and Maintenance, and then click System.
  2. In the System Properties dialog box, on the Advanced tab, under Performance, click Settings.
  3. In the Performance Options dialog box, on the Advanced tab, under Virtual memory, click Change. The Virtual Memory dialog box opens.
  4. Select the hard disk drive you want to use from the Drive list.
    • Select a page file size option:
      Custom Size Choose 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 Choose this option to let Windows XP manage the page file sizes for you.
    • No Paging File Choose this option to disable the page file on the selected drive.
  5. 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. If Custom Size is specified for either or both drives, set the new values now, and then click Set.
  6. Close 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.

Defragment the Paging 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 from your computer, then you should probably defragment 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. Open the Virtual Memory dialog box as described in the previous section.
  2. You have two ways to proceed:
    • If you have a second hard disk drive on your system, first set up a page file on the other hard disk drive using the same initial and maximum values of the original page file. Then select the original drive, select Custom Size, and reduce the initial and maximum sizes to 0 for the page file.
    • If you have only one hard disk drive, note the current values, and then select No Paging File to disable the page file.
    • Restart your computer.
  3. Defragment the hard disk drive that contained the original page file.
  4. Open the Virtual Memory dialog box and restore the original page file settings.
  5. Restart your computer.

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.

 

Related Topics :

© 2013 123seminarsonly.com All Rights Reserved.