This article was previously published under Q130926
A memory leak occurs when a memory pool allocates some of its memory to aprocess and the process does not return the memory. When this happensrepeatedly, the memory pool is depleted.
Finding a Pool Leak
To identify a pool leak:
Find a trend that shows pool memory is being allocated, and the available amount of pool memory is continuously being depleted.
Identify the process that is allocating the memory, but not returning it.
Using Performance Monitor to Identify a Pool Leak
The Memory, Objects, and Processes objects should always be selected whenyou are looking for a pool leak. All counters under each object should beselected. Other object counters can also be selected to help you identify aspecific problem. You then simply view all charted objects until one ormore objects show a trend that could be a pool leak and then investigatethe problem.
By charting the memory resources, it should be clear that one or more memory pools are allocating memory and the available memory in one or more memory pools is being continuously depleted. When charted, a memory pool may display a continuously climbing stair step effect while the process leaking memory is running. However, during times of inactivity, it is common to see the charted line remain flat. The charted line will continue stair pattern the next time the process leaking memory is started and run.
By charting the object counter Object - Threads, it should be evident that the thread count grows in a manner similar to the tagged pool memory allocs and bytes listed in step one. Depending on the amount of threads that are created, the object counter Object - Threads may jump to a high value immediately.
The object Processes should help determine which process is causing the leak. Object counters Pool Nonpaged Bytes, Pool Paged Bytes, and Thread Count should all be selected. Chart all instances of these counters. The process leaking memory should chart in a manner similar to the pool memory that was charted in step one.
An Alternate Method for Identifying a Process that is Leaking Memory
Although Performance Monitor usually provides the necessary information todetermine which process is creating a pool leak, it does not always providethe information necessary to determine the exact cause of a memory leak.A trend can often be identified that shows a memory leak, but an exactprocess may not be identifiable as the cause of the memory leak.
If the process leaking memory is a service, you can identify theprocess using Control Panel (Services) and Performance Monitor:
If the process has been running long enough to show signs of the memory leak, use Performance Monitor to chart the object counter Objects - Threads. The number of threads running will depend on many factors, but the number will grow larger as the process leaking memory continues to run.
Run Control Panel and choose Services.
Tile the windows so you can see both Control Panel and Performance Monitor.
Using Control Panel, start and stop the services one at a time.
If the process that is leaking memory has been running long enough, therewill be a drastic reduction in threads when that process is stopped.
NOTE: The process leaking memory does not have to be a service to use thismethod. If the process leaking memory is a regular program, closing theprogram will also cause the thread count to drop.