.NET Memory Profiler Features
On this page you will find a summary of the things you can do with .NET Memory Profiler.
NOTE! .NET Memory Profiler is available in two editions: Standard and Professional.
All features are not available in the Standard edition. For information about the
features that are included in the different editions, see the
profiler editions page.
Updated! Standard Profiling
Using a wizard you can easily start profiling the following types of processes:
- Standalone application (e.g. a Windows Forms application)
- ASP.NET application (using IIS or WebDev.WebServer)
- New! Silverlight application
- WPF Browser application
- Window Service
A wizard is also provided for connecting the profiler to already running processes,
or to import memory dump files. This is especially useful when profiling problems
in a production application.
New! Use the "attach to" API provided by .NET runtime 4.0 to collect snapshots faster and more
securely.
New! Use the NmpCore tool to collect memory snapshots on machines where .NET Memory Profiler is not installed.

Click the image to magnify.
The new profiling levels allow you to select the amount of information to collect
from the profiled application. The Medium profiling
provides a good balance between the amount of data collected and the performance
impact of the profiler. When profiling a very complex and memory consuming application,
the Low or Very low level
might be more appropriate, as the memory and performance overhead is much lower.
To get full memory information, including heap utilization, use the
High level.
The profiler guides provide interactive step-by-step instructions that will help
you with common memory profiling tasks, such as memory leak investigations.
Snapshot Collection
Collecting snapshots allows detailed information about the garbage collected heap
to be presented. If unmanaged resource tracking is enabled then detailed information
about unmanaged resources is also presented. The views of the heap snapshot are
presented on the Heap Snapshot Views page.
Snapshot Comparison
Comparing snapshots allows information about the change in the heap data to be presented.
This information can for instance be used to find memory leaks by locating instances
that should have been collected. If unmanaged resource tracking is enabled then
change information about unmanaged resource instances is also presented.
Don't know where to start when analysing a memory snapshot? With the new automatic
memory analysis, you will get tips and warnings regarding common memory usage issues.
This will help you locate potential memory leaks and optimize memory and resources
usage.
Currently 28 memory issues are identified by the memory analyser, ranging from warnings about
likely memory leaks, to information
about how memory is used (e.g. by the ASP.NET cache).
The presentation of the change information is integrated into the
Heap Snapshot views.
Using filters you can get information about instances and allocations that share
a common characteristic, e.g. all allocations and instances that are derived
from a specific type, all instances that are directly referenced by a root, or
all allocations performed by a specific method. By combining filters you can get
very specialized information, e.g. all instances of a specific type that are
directly referenced by a root and allocated by methods in a specific assembly.
Peak snapshots can be used to get details information about the peak
memory usage of the application. The peak
snapshot includes information such as the total number of instances
and bytes before the garbage collection, the number of instances and bytes
collected, and the number of instances and bytes that are unreachable but still
exist on the GC heap.
When profiling a WPF or Silverlight application, the profiler will evaluate
DependencyProperties. The properties will be presented as "pseudo-fields" in
views like "Referenced by," "References", "Field values", and "Instance graph"
under the Type instance details page.
Call Stack Information for all Instance
Allocations
The allocation call stack is stored each time a managed instance or unmanaged
resource instance is allocated. This provides very useful information about
why and how instances are created.
The call stacks reducer can be used to decrease memory usage and
improve performance, by automatically skipping less important frames from call stacks.
Full native call stacks are collected using a fast
native stack walker. This will give you a good understanding of how native
memory and resources are used by your application.
Updated! Types, Resources, and Filters Overview
Information about all types
and resources in the profiled process is presented in the
Overview view, which is one of the Heap Snapshot views.
It contains one table that presents information about the types and resource and one table that presents information from the instance and allocation filters.
The Type/Resource/Filter Details
view is one of the Heap Snapshot views. It shows the details of a selected
type or resource, which include:
-
All information available for a type,
resource, or filter is presented using info panels.
This information includes the number of instances , the size
of the instances, and any issues found by the memory analyser. For disposable types it also includes information about the
number of disposed and undisposed instances.
-
All instances of the type or resource.
-
All call stacks that have allocated an instance of the type or resource.
-
Shortest root paths for all instances of the type.
The shortest root paths are combined based on types rather than instances, which
makes it easier to analyze types with a lot of live instances.
Click here for more information..
Updated! Instance Details
Instance Details is one
of the Heap Snapshot views. It shows the details of a selected instance,
which include:
- Information about the instance
For a managed type instance, this information includes the number of bytes
used and held by the instance, age, and state such as "New", "Disposed"
, and any issue found by the memory analyser. For an unmanaged resource instance, this information includes the identifier, size
and state.
- Allocation call stack of the instance
- Root paths for the instance
For a managed type instance the following additional information is presented:
- New! An instance graph showing how the instance is related to other instances
(see below)
- References from and to the instance
- Wrapped unmanaged resource instances
- Field values of the managed type instance
- The target of weak references is presented as a reference to an instance, and is
also presented as a field value.
For an unmanaged resource instance the following additional information is presented:
- Related resource instances
- Managed type instances that wraps the resource instance
- Arguments provided when creating the instance
Click here for more information.
New! Instance Graph
The new instance graph gives you a visual overview of how a managed instance is being used,
how it is related to other instances, and, maybe most importantly,
how roots are preventing it from being garbage collected.
Click here for more information.
Call Stacks and Methods
Call Stacks/Methods is
one of the heap snapshot views. It shows information about all call stacks
and methods in which allocations have been performed.
Native memory information (i.e., memory
that is managed by the operating system rather than the Common Language Runtime)
can be presented for a selected heap snapshot, the profiled process and any other
other process running on the computer.
Dispose Tracker
The dispose tracker is used to identify instances that are not properly
disposed. It can also be used to identify memory leaks by pin-pointing
instances that have been disposed, but not garbage collected. The
information gathered by the dispose tracker is presented in the Heap snapshot views
and in the real-time view.
New! Profile Multiple Runtimes
If multiple versions of the .NET runtime are loaded into the profiled process, a
runtime selector becomes available in the main window.

Click the image to magnify.
Using this selector you can select for which runtime the information should be presented,
or whether information should be presented for all runtimes.
Updated! Focus on a Single Runtime or AppDomain
The
runtime and AppDomain tracker allows you to investigate memory usage in a
specific runtime or AppDomain. This can be particularly useful when profiling
ASP.NET applications that are running in separate AppDomains.
Updated! Real-time
Data Collection
Real-time data about the activity on the GC heap can be collected and presented. This information
gives a good overview over how the memory is being used during the life time of
the profiled process. The real-time information includes information about global
statistics such as the total number of instances, the number of GCs performed etc.
It also includes real-time information about every type in the profiled process.
The information is presented both numerically and graphically.
If unmanaged resource tracking is enabled then information about unmanaged resource
instances is also included in both the numerical and graphical real-time view.
Profiler Projects
.NET Memory Profiler projects can be used to save all settings on how you want to
profile a process, making it easier to use different settings for different applications.
.NET Memory Profiler projects is also used to keep track of session files related
to the project. The profiler projects explorer shows all loaded projects and their
session files and allows you to compare snapshots between different sessions. This
is particularly useful when doing automated testing and you want to check whether
the memory usage has changed between different builds of a program.
The heap utilization tracker can be used to analyze and optimize
the way the garbage collected heap is used.
GC Handle
Identification
GC handles are used to create handles to managed instances. .NET Memory Profiler
tracks the internal GC handles that are created by
the runtime itself or by using the WeakReference and GCHandle types.
The collected GC handles information is presented as a <GCHandle> pseudo-type in the
heap snapshot views.
The .NET Memory Profiler API can be used to control the profiler from within the
profiled process, and to detect potential memory leaks using assertions. This API
is very well suited for doing automated testing of memory usage errors, for instance
by using a unit testing framework like NUnit or MSTest.
For more information see the .NET Memory Profiler API examples.
Command line arguments can be supplied to the profiler. Together with the .NET Memory
Profiler API this allows the profiler to be used in an automated testing environment,
without any user interaction.
.NET Memory Profiler can be used to profile processes running under all versions
of .NET Framework, except .NET Framework 1.x.
Visual Studio integration allows you to start profiling C# and Visual Basic.NET
projects from within the development environment, as well as open previously stored
session files. Support for the ASP.NET development server (WebDev.WebServer) in
Visual Studio 2005/2008/2010 allows you to easily profile ASP.NET projects, without affecting
other web sites.