Making sure you have enough memory
Memory usage is perhaps the most important factor in system performance. One of the ways you may become aware of a memory shortage is if your system is paging frequently. Paging is the process of moving fixed size blocks of code and data from RAM to disk using units called pages in order to free memory for other uses. Although some paging is acceptable because it enables to use more memory than actually exists, constant paging is a drain on system performance. Reducing paging will significantly improve system responsiveness.
This section describes how you can determine whether your system has an adequate amount of memory and an appropriate configuration for its role, plus how to begin to analyze its paging activity. (Further discussion of paging and related factors appears in Checking for excessive paging)
Checking your configuration
Before beginning to monitor memory usage on your computer in detail, verify that your computer is properly equipped and configured:
Monitoring memory counters
To monitor for a low-memory condition, start with the following object counters:
Available Bytes indicates how many bytes of memory are currently available for use by processes. Pages/sec provides the number of pages that were either retrieved from disk due to hard page faults or written to disk to free space in the working set due to page faults.
Low values for Available Bytes (4 MB or less) may indicate there is an overall shortage of memory on your computer or that a program is not releasing memory. If the value of Pages/sec is 20 or more, you should research the paging activity further. A high rate for Pages/sec may not indicate a memory problem but may instead be the result of running a program that uses a memory-mapped file.
You must monitor Available Bytes along with Pages/sec and Paging File % Usage to determine whether this is the case. If you are reading a noncached memory-mapped file, you should also see normal or low cache activity. For more information, see Checking for excessive paging
If you suspect a memory leak, monitor Memory\Available Bytes and Memory\Committed Bytes to observe memory behavior and monitor Process\Private Bytes, Process\Working Set, and Process\Handle Count for processes you think may be leaking memory. Also monitor Memory\Pool Nonpaged Bytes, Memory\Pool Nonpaged Allocs, and Process(process_name)\Pool Nonpaged Bytes if you suspect that a kernel-mode process is causing the leak.
Checking for excessive paging
Because excessive paging can make substantial use of the hard disk, it is possible to confuse a memory shortage that causes paging with a disk bottleneck that results in paging. As a result, when you investigate the causes of paging, where a memory shortage is not apparent, make sure to track disk usage counters such as the following along with memory counters:
For example, include Page Reads/sec with % Disk Time and Avg. Disk Queue Length. If a low rate of page-read operations coincides with high values for % Disk Time and Avg. Disk Queue Length, there could be a disk bottleneck. However, if an increase in queue length is not accompanied by a decrease in the pages-read rate, then a memory shortage exists.
To determine the impact of excessive paging on disk activity, multiply the values of the Physical Disk\Avg. Disk sec/Transfer and Memory\Pages/sec counters. If the product of these counters exceeds 0.1, paging is taking more than 10 percent of disk access time. If this occurs over a long period, you probably need more memory.
Investigating program activity
Next, check for excessive paging due to programs that are running. If possible, stop the program with the highest working set value and see whether that dramatically changes the paging rate. If you suspect excessive paging, check the Memory\Pages/sec counter. This counter shows the number of pages that needed to be read from disk because they were not in physical memory. (Notice the difference between this counter and Page Faults/sec, which indicates only that data was not immediately available in the specified working set in memory.)
Checking the paging file size
You have some options for how to manage your paging file for better performance:
If multiple paging files are spread across multiple disk drives, the path name of each file appears as an instance of the Paging File object type. You can either add a counter for each paging file or select the _Total instance to look at combined usage data for all your paging files.