This section describes the counters that provide information pertaining to exceptions thrown by the .NET application.
# of Excep Thrown/sec
Official Name .NET CLR Exception/# of Excep Thrown/sec (_Global_) Counter Type Instantaneous (sampled once during each
measurement period).
Description This counter displays the number of exceptions thrown per second. These include both .NET exceptions and unmanaged exceptions.
Usage Notes This counter includes both handled and unhandled exceptions. Exceptions should only occur in rare situations and not in the normal control flow of the program.
Performance Indicator of potential performance problems due to large rate of exceptions thrown.
Operations This has to be 0 under normal circumstances.
Threshold Error if rate is larger than 100.
Throw to Catch Depth/Sec
Memory Counters
This section describes the counters that belong to memory management of .NET CLR. They provide data about memory consumption, memory pools, and garbage collection statistics.
The common language runtime's garbage collector (GC) manages the allocation and release of memory for an application. This automatic memory management can eliminate common problems, such as forgetting to free an object and causing a memory leak, or attempting to access memory for an object that has already been freed.
When a .NET application is initialized, the runtime reserves a contiguous region of address space for the process. This reserved address space is called the managed heap. When an application is created the first object,
memory, is allocated at the base address of the managed heap. When the application creates the next object, the garbage collector allocates memory for it in the address space immediately following the first object. As long as
Official Name .NET CLR Exception/Throw to Catch Depth/Sec.
Counter Type Instantaneous (sampled once during each measurement period).
Description Displays the number of stack frames traversed from the frame that threw the .NET exception to the frame that handled the exception per second.
Usage Notes Resets to 0 when an exception handler is entered; so nested exceptions would show the handler to handler stack depth.
Performance Secondary indicator to determine code shortcomings that may pose a potential bottleneck.
Operations N/A
Threshold N/A
To optimize the performance of the garbage collector, the managed heap is divided into three generations: Gen 0, Gen 1, and Gen 2. The runtime's garbage collector stores new objects in Gen 0. Objects created early in the application's lifetime that survive collections are promoted and stored in Gen 1 and Gen 2. This scheme allows the garbage collector to release the memory in a specific generation faster, rather than release the memory for the entire managed heap each time it performs a collection.
Large Object Heap Size
Official Name .NET CLR Memory\Large Object Heap Size.
Counter Type Instantaneous (sampled once during each measurement period).
Description The amount of memory in bytes currently used by Large Object Heap.
Usage Notes Objects greater than 20KBytes are treated as large objects by the garbage collector and are directly allocated in a special heap, which is measured by High CPU utilization.
Performance Important indicator to determine code deficiency as releasing the entire heap takes more time than when generational algorithm works properly. Usually called Fragmented Large Object heap bottleneck.
Operations Large Objects are not promoted through the generations.
Threshold N/A
# Bytes in all Heaps
Official Name .NET CLR Memory\# Bytes in all Heaps Counter Type Instantaneous (sampled once during each
measurement period)
Description Shows the current memory allocated in bytes on the GC heaps.
Usage Notes This counter is the sum of the Gen 0 Heap Size, Gen 1 Heap Size, Gen 2 Heap Size, and the Large Object Heap Size counters. This counter indicates the current memory allocated in bytes on the garbage collection heaps.
Performance While using large data sets in memory, excess cache entries, using reg-ex and string parsing, excess view-state or excessive session objects contribute to the heavy memory requirement.
Operations You usually start monitoring from this selecting counter.
An increase in Private Bytes while the # of Bytes in all heaps counter remains the same indicates unmanaged memory consumption. An increase in both counters indicates managed memory consumption.
Threshold Should be less than the Process\Private Bytes counter
# of Pinned Objects
Official Name .NET CLR Memory\# of Pinned Objects.
Counter Type Instantaneous (sampled once during each measurement period).
Description Displays the number of pinned objects encountered in the last GC.
Usage Notes A pinned object is one that the garbage collector cannot move in memory. This counter tracks the pinned objects only in the heaps that were garbage collected; for example, a Gen 0 garbage collection would cause enumeration of pinned objects in the Gen 0 heap only.
Performance N/A
Operations N/A
Threshold N/A
% Time in GC
Thread Counters
A thread relates to a thread of execution in a program. A .NET logical thread object is created either implicitly by issuing a new
System.Threading.Thread command inside the code or explicitly when an unmanaged thread enters the managed environment. There are also
physical threads, created and owned by the CLR which are essentially native OS acting as underlying threads for .NET thread objects. The .NET
application may make usage of recognized threads which are not created by the CLR - they are created outside the CLR but have since run inside the CLR at least once.
Official Name .NET CLR Memory\% Time in GC.
Counter Type Elapsed time.
Description The percentage of elapsed time that was spent performing a garbage collection (GC) since the last GC cycle.
Usage Notes An indicator of the work done by the garbage collector on behalf of the application to collect and compact memory.
Performance Allocating large strings to cache, heavy string operations, and so on, leave a lot of memory spaces the GC has to clean up.
Operations Updated only at the end of every GC, and the counter value reflects the last observed value; it is not an average. If there are any spikes in this counter, then those are accepted.
Threshold Should be in the range of 5-10%.
# of Current Logical Threads
# of Current Physical Threads
Official Name .NET CLR LocksAndThreads\# of Current Logical Threads.
Counter Type Instantaneous (sampled once during each measurement period).
Description Displays the number of current managed thread objects in the application.
Usage Notes This counter maintains the count of both running and stopped threads.
Performance Too many threads may cause slow garbage collection operation.
Operations N/A
Threshold N/A
Official Name .NET CLR LocksAndThreads\# of Current Physical Threads.
Counter Type Instantaneous (sampled once during each measurement period).
Description Represents the number of native operating system threads created and owned by the common language runtime to act as underlying threads for managed thread objects.
Usage Notes This is subset of the threads in the OS process.
Performance N/A
Operations This counter does not include the threads used by the CLR in its internal operations.
Threshold N/A
# of Current Recognized Threads
# of Total Recognized Threads
Official Name .NET CLR LocksAndThreads\# of Current Recognized Threads.
Counter Type Instantaneous (sampled once during each measurement period).
Description Shows the number of threads currently recognized by the CLR.
Usage Notes Only unique threads are tracked.
Performance N/A
Operations Threads with the same thread ID reentering the CLR or recreated after thread exit are not counted twice.
Threshold N/A
Official Name .NET CLR LocksAndThreads\# of Total Recognized Threads.
Counter Type Cumulative.
Description Total number of threads recognized by the CLR since the start of this application.
Usage Notes Only unique threads are tracked.
Performance N/A
Operations Threads with the same thread ID reentering the CLR or recreated after thread exit are not counted twice.
Threshold N/A
Contention Rate/Sec
Official Name .NET CLR LocksAndThreads\Contention Rate/Sec.
Counter Type Instantaneous (sampled once during each measurement period).
Description Rate at which threads in the runtime unsuccessfully attempt to acquire a managed lock.
Usage Notes An increase in the contention rate or a significant increase in the total number of contentions is a strong indication that an application is encountering thread contention. To resolve this issue, one has to identify code that accesses shared resources or uses
synchronization mechanisms.
Performance Along with Total Number of Contentions, may point to thread bottleneck.
Operations N/A
Threshold N/A