Task Manager. Task Manager lets you easily check for the correct paging file size. Task Manager shows you how the system is using the paging file and gives you other vital system information. To run Task Manager in NT 4.0, press Ctrl+Alt+Del and select Task Manager, or right-click the taskbar and select Task Manager. After you start Task Manager, click the Performance tab to get realtime system statistics, as Screen 2 shows. The most important paging file size information on the Performance tab is the Commit Charge section. This section tells you whether the Commit Peak (the highest amount of physical and virtual memory the system has allocated to processes thus far) has approached or exceeded the Commit Limit or the system's physical memory. Commit Limit is the amount of virtual memory that the system can commit to memory without expanding the paging file.
As paging activity increases, the Commit Total (committed memory) also increases. The system needs to expand the paging file as the Commit Total approaches the Commit Limit. The goal is to prevent the paging file from expanding, so you need to keep the Commit Total from approaching the Commit Limit. The worst case occurs when the two values are equal and the paging file can't grow to meet system requirements.
Task Manager's Commit Charge section also tells you whether the system's main memory can accommodate system tasks. If the Commit Total regularly exceeds the system's RAM, the system might not have enough physical memory. For example, if a system with 64MB of RAM also has a Commit Total of 64MB, the system needs additional physical memory.
NT Diagnostics. Like Task Manager, NT Diagnostics displays system statistics related to processes and memory. However, this tool doesn't present information in realtime. You must manually refresh the display to get current information. On the Memory tab, click Refresh, which Screen 3 shows. NT Diagnostics is useful in estimating but not calculating a minimum paging file size.
Performance Monitor. Perfmon is the best and most reliable tool for determining a minimum paging file size. Perfmon lets you monitor counters that pertain to virtual memory. Before you start monitoring the counters, follow Microsoft's recommendation (physical RAM + 11MB) to set the minimum paging file size. Then you can monitor typical operations' memory use.
The four main counters for monitoring virtual memory are Memory: Committed Bytes, Memory: Commit Limit, Paging File: % Usage, and Paging File: % Usage Peak. The following list explains how each of these counters helps you determine minimum paging file requirements:
- Memory: Committed Bytes shows the amount of virtual memory that processes are currently using. Memory: Committed Bytes is the amount of committed rather than reserved virtual memory.
- Memory: Commit Limit shows the amount of virtual memory the system can commit without expanding the paging file. Commit Limit equals physical memory plus the paging file size, minus the memory reserved for the operating system (OSwhich is a dynamic value).
- Paging File: % Usage shows the percentage of the paging file that processes are currently using.
- Paging File: % Usage Peak shows the highest percentage of space the paging file is using.
The Committed Bytes and Commit Limit counters work side by side. If you monitor the counters separately, you won't have enough information to properly set the paging file's minimum size. You must monitor both counters to determine whether the paging file is approaching or has reached full capacity. When the Committed Bytes approaches the Commit Limit, the system is running out of virtual memory. The system will warn you of this problem, as Screen 4 shows. You must then close some applications, manually increase the paging file, and restart the system. Committed Bytes won't exceed the Commit Limit if you configure the minimum paging file size properly. You can add an alerting mechanism that will warn you if the Committed Bytes value becomes too large. Perfmon can also alert you when the Committed Bytes is within 20 percent of the Commit Limit.
To add and configure alerts in Perfmon, choose Alert from the View menu. Next, select Add to Alert from the Edit menu to add counters. Choose the object you want to monitor and the appropriate counter within it. For example, choose the Memory: Commit Limit counter. For the Alert If option, specify a value for the counter. Select Over if you want Perfmon to trigger an alert when the counter exceeds this value, or Under if you want Perfmon to trigger an alert when the counter falls below this value. In the Run Program on Alert box, you might want to specify an application, such as paging software, to run. When you finish configuring the alert options for the counter, click Add to add the counter to the alerting scheme.
If the Committed Bytes counter equals or exceeds the Commit Limit, the system is experiencing excessive hard page faults because you haven't properly configured the minimum and maximum paging file size to meet memory usage requirements. A hard page fault occurs when the system has to retrieve a page from the hard disk rather than main memory; hard page faults significantly delay performance. The Memory: Pages/sec counter shows the number of hard page faults. When the system runs low on virtual memory, the Memory: Pages/sec counter exceeds 20 pages per second, and system performance decreases significantly. To prevent this problem, increase the paging file size to accommodate the largest memory usage requirements.
Other counters you can use to determine minimum paging file size are Paging File: % Usage and Paging File: % Usage Peak. You can use these counters together or monitor them separately to determine what percentage of the paging file the system is using. Recommended values are % Usage counter below 40 percent and % Usage Peak below 75 percent. If the counters stay in the acceptable ranges, the system won't have to increase the paging file.
You can use these counters to estimate how much physical memory the system needs to keep from relying on the paging file. For example, if the minimum paging file size is 80MB and the % Usage counter averages 20 percent, you can add 16MB of RAM to the system and thus reduce the percent usage. In this case, 20 percent paging file use tells you that if you add memory equal to 20 percent of the paging file, the system's main memory will accommodate most server functions without relying on the paging file.
You also need to consider maximum paging file size to boost the paging performance on your system. The maximum value is the highest value you expect the paging file to grow, and you must have enough free hard disk space to accommodate this limit. A general rule is to set the maximum paging file value at the minimum value plus 50 percent. However, if you configure the minimum paging file size properly, the system is unlikely to approach the maximum value. Your paging performance will be optimal if you properly configure the minimum paging file size and set the maximum paging file size to the recommended value.
Recommendations
NT's reliance on paging can benefit the system and user applications, but paging sometimes negatively affects performance. You can't always add memory to the system configuration, and adding memory doesn't necessarily correct paging performance problems. However, you'll want to configure your system with as much memory as possible because it's currently inexpensive. You must consider several alternatives to increase your system's paging performance, including proactive monitoring, proper paging file configuration, and location. If you properly configure the minimum and maximum paging file size, you reduce the risk of compromising performance during peak memory utilization periods.