Posts tagged ‘counters’

February 13, 2012

Memory Troubleshooting

  1. Task manager | sort by memory
  2. Use counters | http://teamapproach.ca/trouble/Leak.htm The following graphs are an example of an application with a memory leak. The leaky application is constantly requesting more memory. It is characterized by increasing Process/Page File Bytes at the same rate as the system Committed Bytes; i.e. all memory commitment is due to one process. Available Bytes are decreasing steadily until the system pages something out and then the Virtual Bytes increase to make room for more Available Bytes. The Working Set of the leaky application actually decreases when parts of it get paged out. Note how Page Faults/sec increases as Available Bytes decline.

If you suspect that a particular application or service is causing a memory leak, investigate the memory use of your applications using the following counters:

Memory\Available Bytes reports available bytes; its value tends to fall during a memory leak.
Memory\Committed Bytes reports the private bytes committed to processes; its value tends to rise during a memory leak.
Process\Private Bytes reports bytes allocated exclusively for a specific process; its value tends to rise for a leaking process.
Process\Working Set reports the shared and private bytes allocated to a process; its value tends to rise for a leaking process.
Process\Page Faults/sec reports the total number of faults (hard and soft faults) caused by a process; its value tends to rise for a leaking process.
Process\Page File Bytes reports the size of the paging file; its value tends to rise during a memory leak.
Process\Handle Count reports the number of handles that an application opened for objects it creates. Handles are used by programs to identify resources they must access. The value of this counter tends to rise during a memory leak; however, you cannot rule out a leak simply because this counter’s value is stable.
Memory Leaks and the Nonpaged Pool

Although any leak is serious, memory leaks are of particular concern when they involve the nonpaged pool. Many system services allocate memory from the nonpaged pool because they need to reference it when processing an interrupt and cannot take a page fault at that time. To identify whether or not a leak affects the nonpaged pool, include the following counters in your monitoring:

Memory\Pool Nonpaged Bytes
Memory\Pool Nonpaged Allocs
Process\Pool Nonpaged Bytes
Portrait of a Leaky Application

 

Here is a small guide from Microsoft

Setup a performance monitor log
Please use the following steps to start performance logging on your server.
1. Permanently disable all screen savers.
2. Go to Start, Run and type “perfmon” (without quotation marks) and press OK.
3. Expand Performance Logs and Alerts. Highlight Counter Logs and right click in the right pane to bring up a menu. From this menu, select “New Log Settings”. Give this log a name.
4. Press Add. Verify the correct computer is selected in the “Select counters from computer:” drop-down.
5. Add “All counters” and “All instances” each of the following objects:

Memory
Network Interface
Objects
Paging File
Physical Disk
Process
Processor
Redirector
Server
Server Work Queues
System

6. Set the Interval for every 10 seconds.
7. Click on the Log Files tab and set Log file type to Binary Circular File and a Limit of 256 MB. Please make sure where the Log is currently save have enough disk space to accommodate.
If you are rebooting the server for setting up the Registry Setting please make sure that you start the perfmon again after the server is rebooted. Perfmon will not start automatically

Tags: