Using Performance Monitor To Identify A Pool Leak

Last reviewed: February 12, 1998
Article ID: Q130926

The information in this article applies to:
  • Microsoft Windows NT operating system version 3.1
  • Microsoft Windows NT Advanced Server version 3.1
  • Microsoft Windows NT Workstation versions 3.5, 3.51, and 4.0
  • Microsoft Windows NT Server versions 3.5, 3.51, and 4.0

SUMMARY

A memory leak occurs when a memory pool allocates some of its memory to a process and the process does not return the memory. When this happens repeatedly, the memory pool is depleted.

MORE INFORMATION

Finding a Pool Leak

To identify a pool leak:

  1. Find a trend that shows pool memory is being allocated, and the available amount of pool memory is continuously being depleted.

  2. 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 when you are looking for a pool leak. All counters under each object should be selected. Other object counters can also be selected to help you identify a specific problem. You then simply view all charted objects until one or more objects show a trend that could be a pool leak and then investigate the problem.

  1. 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.

  2. By charting the object counter Object - Threads, it should be evident that the thread count grows in a manor 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.

  3. 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 manor 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 to determine which process is creating a pool leak, it does not always provide the information necessary to determine the exact cause of a memory leak. A trend can often be identified that shows a memory leak, but an exact process may not be identifiable as the cause of the memory leak.

If the process leaking memory is a service, you can identify the process using Control Panel (Services) and Performance Monitor:

  1. 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.

  2. Run Control Panel and choose Services.

  3. Tile the windows so you can see both Control Panel and Performance Monitor.

  4. Using Control Panel, start and stop the services one at a time.

If the process that is leaking memory has been running long enough, there will 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 this method. If the process leaking memory is a regular program, closing the program will also cause the thread count to drop. Version : WinNT:3.1,3.5,3.51,4.0


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 12, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.