Adjusting Paging File Size

For virtual-memory support, Windows 2000 creates one paging file called Pagefile.sys on the disk or volume on which the operating system is installed. The default size is equal to 1.5 times the amount of physical memory. A small paging file limits what can be stored and might exhaust your virtual memory for applications. If you are short on RAM, more paging occurs, which generates extra activity for your disks and slows response times for the system.



Special considerations apply for sizing the paging file on Windows 2000 Advanced Server when you are using 4 gigabyte RAM tuning (4GT). For more information, see Windows 2000 Advanced Server Help.

Because the size and location of paging files can affect your system's performance, you might want to modify these. Also, because maintaining multiple files on multiple drives can improve performance, you might want to add a paging file. Figure 6.3 shows the Virtual Memory dialog box, which you use to change your paging file settings. See Windows 2000 Server Help for specific instructions.


Figure 6.3 Virtual Memory Dialog Box

The following guidelines describe how to optimize the paging file.

Set the Same Initial and Maximum Size

Setting the paging file's initial size and maximum size to the same value increases efficiency because the operating system does not need to expand the file during processing. Setting different values for initial and maximum size can contribute to disk fragmentation.

Expand the Default Size

Expanding the default size of the paging file can increase performance if applications are consuming virtual memory and the full capacity of the existing file is being used. To determine how large your paging file should be based on your system workload, monitor the Process (_Total)\Page File Bytes counter. This indicates, in bytes, how much of the paging file is being used.

You can also determine the appropriate size of a paging file by multiplying the Paging File\% Usage Peak counter value by the size of Pagefile.sys. The % Usage Peak counter indicates how much of the paging file is being used. You should consider expanding the page file whenever this counter reaches 70 percent of the total size in bytes of all paging files or the Memory\% Committed Bytes In Use counter reaches 85%, whichever occurs first.

A large paging file uses disk storage space, so do not create a large paging file on a disk that is very active (for example, one that services heavy application or network activity) or one that has limited space. Change the file size gradually and test performance until you find the optimal balance between paging file and disk space usage. The operating system requires a minimum of 5 MB of free space on a disk. For more information, see "Examining and Tuning Disk Performance" in this book.

Before increasing the file size, make sure you have adequate disk space, particularly on your servers. For more information, see "Monitoring Network Performance" in this book.

Move the Paging File

If disk space on your boot volume is limited, you can achieve better performance by moving the paging file to another volume. However, you might want to leave a smaller paging file on the boot volume and maintain a larger file on different volume with more capacity for the sake of recoverability. Depending on how you have configured your system's startup and recovery options, the configuration might require that you maintain a paging file of a certain size on the boot volume. Therefore, make sure to consider your startup and recovery settings when planning to move the paging file. For information about startup and recovery options such as writing debugging information, see Windows 2000 Help.

Use Multiple Disks

Although Windows 2000 supports a limit of 4,095 MB for each paging file, you can supply large amounts of virtual memory to applications by maintaining multiple paging files. Spreading paging files across multiple disk drives and controllers improves performance on most modern disk systems because multiple disks can process input/output (I/O) requests concurrently in a round-robin fashion.

A mirrored or striped volume is a good candidate for placement of a paging file. Placing the paging file on its own logical partition can prevent file fragmentation. Creating multiple paging files on a single logical volume or partition does not improve performance.

If you find that page writing and disk writing or page reading and disk reading are equivalent on a logical disk, splitting the paging file onto separate volumes is helpful.

Set a Smaller Default Size for Systems Running Windows 2000 Advanced Server

If you are working in an enterprise environment using the 4-GB RAM Tuning (4GT) option and have a system with more than 4 GB of physical memory, you might want to consider changing the default size of your paging file. In Windows 2000, the default paging file size is equal to 1.5 times the amount of physical memory on the system. On a 4-GB computer, this might result in a paging file too large to be effective. A 256-MB paging file might be a more effective use of disk space. However, a smaller paging size affects the size of total committed memory for applications. For best results, review these settings with the independent software vendor (ISV) for your applications that are being run with the 4GT option. For more information about 4GT, see Windows 2000 Advanced Server Help.



To see how the paging file is used during memory shortages, start the LeakyApp tool on the Windows   2000 Resource Kit companion CD, designed to simulate memory leaks for monitoring purposes. While running LeakyApp, monitor Paging File\% Usage and Process(_Total)\Page File Bytes. Log these counters to get an idea of the rate of growth of the paging file.