1 / 12

How to Detect a Memory Leak By Using System Performance Monitor in Windows 2000

How to Detect a Memory Leak By Using System Performance Monitor in Windows 2000. Overview. What is a memory leak? Establish a baseline to detect memory leaks Different types of memory/resources Which counters to select to detect memory leaks in System Performance Monitor

jerod
Télécharger la présentation

How to Detect a Memory Leak By Using System Performance Monitor in Windows 2000

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. How to Detect a Memory Leak By Using System Performance Monitor in Windows 2000

  2. Overview • What is a memory leak? • Establish a baseline to detect memory leaks • Different types of memory/resources • Which counters to select to detect memory leaks in System Performance Monitor • Examples of memory leaks • What to do when you find a memory leak

  3. What Is a Memory Leak? • A memory leak occurs when a program uses resources on a computer but never releases the resources. The resources can include handles, physical RAM, the paging file, system resources, etc. • Symptoms of a memory leak includesystem hangs, slow system performance, and program memory error messages.

  4. Establish a Baseline • Before trying to detect a memory leak, gather a log on a computer that has the same role, hardware, and basic programs to determine a baseline for each process. Each process has a set of code that allocates resources uniquely. When a process starts, resource allocation can increase rapidly. However, resource allocation should level off after a period of time. To establish a memory leak, resource allocation for that process should continue to increase on a very consistent basis over a period of time. • See article Q240389 in the Microsoft Knowledge Base to set up a performance log.

  5. Different Types of Resources • Private bytes – resources the process has allocated that cannot be shared with other processes. • Pool page bytes – an area of system memory (physical memory used by Windows 2000) for objects that can be written to disk when they are not being used.

  6. Different Types of Resources • Pool non-page bytes – an area of system memory for objects that cannot be written to disk but which must remain in physical memory. (The limit is 256 MB). • Pool page bytes/pool non-page bytes are areas of system memory set aside by Windows 2000 for system components. • Handles are the sum of the number of file handles that are owned by each thread in the process.

  7. Counters to Detect Memory Leak Under the memory object, click the Available Bytes counter.

  8. Counters to Detect Memory Leak Under the process object, click the Handle Count, Pool Nonpaged Bytes, Pool Paged Bytes, and Private Bytes counters for the process that may be having the problem.

  9. Chart View of Performance Monitor Displays the selected counters: Available Bytes, Handle Count, Pool Nonpaged Bytes, Pool Paged Bytes, and Private Bytes.

  10. Example of Private Byte Memory Leak In this example, the Private Bytes count for the process is consistently increasing. It never decreases, indicating that the BugBug process has a memory leak.

  11. Example of Handle Count Memory Leak In this example, the Handle count for the process is consistently increasing. It never decreases, indicating that the BugBug process has a memory leak.

  12. What to Do When You Find a Memory Leak • Stop any service related to that process. • Stop any process that may interact with the process with a memory leak. • If the process is part of a third-party program, contact the manufacturer for any updates to the program. If it is a Microsoft process or program, check the Microsoft Knowledge Base for any known issues. If there are no known issues with the Microsoft process or program, contact Microsoft Product Support Services.

More Related