Ok so now we know what to look for how to we look for it?
Tools
Task Manager
Task manager can quickly provide general memory information. On the performance tab, you can quickly determine how much physical memory is in the system, how much physical memory is available, Kernel memory usage and how much memory the VMM has promised to running processes. With this information you can determine if further investigation is required.
The processes tab also has a wealth of information, but first you have to enable additional columns via the View à Select Columns option. On this tab you can quickly determine the amount of memory a process is using and how much of the paged & nonpaged pool is being used. There many addition columns available, so don’t settle for the default view.
Process Explorer
Process Explorer does everything task manager does and more. You can really dig into a process and figure exactly what it’s doing and what kind of resources it’s consuming.
Get it here: http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
Poolmon
Poolmon is a great tool for tracking down kernel memory leaks or just determining what is consuming kernel resources .
More info here: http://support.microsoft.com/kb/177415
& here: http://technet2.microsoft.com/windowsserver/en/library/0d302498-c947-4655-95af-719ae75acfb51033.mspx?mfr=true
Performance Counters
Memory\Available Mbytes (MB): Indicates the amount of physical memory (in MB) immediately available for allocation to a process or for system use. Used with the Pages/Sec to determine if the system is low on physical memory.
Memory\Pages/sec: Pages/sec is the number of pages read from the disk or written to the disk to resolve memory references to pages that were not in memory at the time of the reference (hard page faults), and the number of pages that were redirected to memory outside of the working set. This counter also includes paging traffic on behalf of the system Cache to access file data for applications, so a large number alone is not reason for concern just further investigation. This is the primary counter to observe if you are concerned about excessive memory thrashing.
Memory\Pool Nonpaged Bytes: This counter shows the current size of the Nonpaged pool in Bytes. Anything over 200MB should be investigated, and unless memory tuning options are in place (/3GB) then anything over 100MB.
Memory\Pool Paged Bytes: This counter shows the current size of the paged pool in Bytes. In general anything over ~250MB should be investigated unless memory tuning options are in place (/3GB) then anything over 150MB.
Memory\Free System Page Table Entries: This counter shows the number of page table entries that are available for use. Anything under 8,000 needs a closer look. If the system is getting low consider using the /userva=XXXX with something like 3030 to start to bump these up.
Memory: Cache Bytes: This is the size of the system cache. You can use this counter with the Pool nonpaged/paged & PTEs to determine who kernel memory is being allocated.
Registry Keys
As with all registry modifications, use caution. Under normal circumstances you should not need to modify these keys, but if you are running into kernel memory issues proper use of these keys can resolve the problem.
NonPagedPoolLimit: Specifies the maximum amount of system VA space that can be used by the nonpaged pool.
PagedPoolLimit: Specifies the maximum amount of system VA space that can be used by the paged pool.
SystemCacheLimit: Specifies the maximum amount of system VA space that can be used by the system cache.
SystemPtesLimit: Specifies the maximum amount of system VA space that can be used by I/O mappings and other resources that consume system page table entries (PTEs).
SessionSpaceLimit: Specifies the maximum amount of system VA space that can be used by session space allocations
PoolUsageMaximum: Determines the Max Poll usage before pruning starts. The default is 80%. A value of 40-60 provides a workable solution to some paged pool exhaustion issues.
So that’s all the fun tools, counters and registry keys in a nutshell. In the next installment we’ll go over a real world example of isolating memory issues and providing workarounds.