The way virtual memory, or the swap file, operates in Windows 2000 is often misunderstood. Many administrators believe that setting the swap file larger will automatically translate to better performance, since this provides more memory for the system. The truth is more complicated; bigger is not always better.
The Windows 2000 swap file is used for two things: swapping out pages of memory to disk as needed, and temporarily dumping kernels when a crash is logged. (If you have no swap file set up on your boot drive, you may not be able to get a kernel dump when a crash happens.) Memory swapping, which includes paging out the kernel, takes place less on machines that have more physical memory, if only because there is less demand for it. A machine with 128 MB of physical RAM will swap a lot more often than a machine with 512 MB of RAM, simply because a 512-MB machine is able to accommodate more in memory at the same time. This may sound elementary, but many administrators believe that the minimum size of the swap file should be anywhere from the size of the physical memory to as much as two and a half times as large. While this is not flat-out wrong, it may be overkill, and some real-world numbers may illustrate what's needed more clearly.
If you want to verify the amount of swap file usage for yourself during system activity, which can help put to rest any illusions about how big the swap file really needs to be, you can do this fairly easily. Open the Performance Monitor snap-in and add a counter for Pagefile Usage, with intervals of 20 seconds to one minute, and then begin running a set of tasks that reflect the server's normal usage load. From this you can observe the total percentage of the swap file's use.
If you have a lot of space allocated to the swap file (meaning more than the recommended allocation), but your usage does not reflect a sizeable percentage of the existing swap file space, cut it back to the system-recommended minimum if you haven't already. This not only saves disk space, but uses less resources required to maintain a bigger swap file.
Serdar Yegulalp is the editor of the Windows 2000 Power Users Newsletter. Check out his Windows 2000 blog for his latest advice and musings on the world of Windows network administrators -- please share your thoughts as well!