Recipe 18.5. Optimizing Page File Size


Problem

You want to optimize your page file size, because you're getting out-of-memory errors, or so that you can make the most efficient use of your RAM and speed up system performance.

Solution

Using a graphical user interface

  1. Right-click My Computer, choose Properties, and click the Advanced tab.

  2. The Advanced tab of the System Properties dialog box appears.

  3. In the Performance section, click Settings and choose the Advanced tab.

  4. In the Virtual memory section, click Change. The Virtual Memory dialog box appears, pictured in Figure 18-5. The dialog box shows you the location of your swap file, as well as the file's initial size and maximum size.

    Figure 18-5. Customize the size of your swap file to get better performance


  5. Click Custom, then type the initial size and the maximum size you want for your swap file and click Set.

  6. You have three options for changing the size and behavior of your swap file:


    Custom size

    This is the default setting on most XP systems. It lets you set the minimum and maximum sizes for the swap file. By default, the minimum size is 1.5 the size of your RAM, and the maximum size is twice the size of the minimum size. The minimum size XP allows is 2 MB. If youve been getting "out of memory" errors, increase the initial size by at least 25%. Set the maximum size to twice the initial size. If you have 512 MB or more of memory, and you haven't been getting "out of memory" errors, consider reducing the initial size by at least 10%. Doing this will give you more hard disk space, but in all likelihood wont adversely affect system performance. If you shrink the default sizes and you get an "out of memory" message at some point, increase the size of the swap file.


    System managed size

    When you choose this option, you'll let XP determine the minimum and maximum swap file sizes by itself, automatically.


    No paging file

    This option lets you run XP without a swap file. No matter how much RAM you have, it's not a good idea to choose this option. Some programs require the presence of a swap file, and Windows itself may behave erratically without a swap file.

  7. Click OK, and OK on each dialog box until you've closed them all. If you've chosen to decrease the minimum size of the swap file, you probably won't have to restart for the changes to take effect. But if you've increased the minimum size, you have to restart your PC.

Discussion

The paging file, also called a swap file, is a file that XP creates to store data or program files on your hard disk when they can no longer fit into your system RAM. XP sets your initial swap file size at 1.5 times the amount of RAM on your system. So if you have 1 GB of RAM, your initial swap file size would be 1.5 GB. As you use your computer, XP allows the swap file to shrink or grow, depending on whether the operating system needs more or less memory. To see the size of your swap file, look for the file pagefile.sys, typically found in the root directory.

pagefile.sys is a system file. XP normally hides system files so they're not visible in Windows Explorer. To make them visible, run Windows Explorer, choose Tools Folder Options, click View, and in the Advanced Settings section, select "Show hidden files and folders." Uncheck the box next to "Hide protected operating system files" and click OK.


If you ever get a message from XP saying "out of memory," it means your swap file is too small, so you should increase it. But if you have a system with 512 MB of memory or more, consider decreasing the size of the swap file, because XP probably doesn't need all the RAM it's devoting to that file which means you're giving up precious hard disk space unnecessarily.

See Also

For help in determining the minimum page file size, see MS KB 101220, "Minimum Paging File Size"



Windows XP Cookbook
Windows XP Cookbook (Cookbooks)
ISBN: 0596007256
EAN: 2147483647
Year: 2006
Pages: 408

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net