Profile a .NET Process
Using .NET Memory Profiler, it is possible to profile the memory of the following kinds of processes:
Stand-alone application
ASP.NET
Window Store App
Silverlight application
WPF Browser application
Windows Service
It is also possible to profile the memory of an already running .NET process by using the “attach to” function.
To profile the memory of a process, perform the following steps:
Start the process you want to profile by following the “how to” instructions for the desired kind of process:
Or use the
Attach to Process command to attach to an already running process. For more information see Attach to a Process.
When you have performed the necessary steps to start profiling and the process is running, you can select the Collect Heap Snapshot command to retrieve information about the GC heap. This information includes all classes that have had any allocated instance and the call stacks of those allocations. The information about all the classes is presented under the Types/Resources page. Information about call stacks and methods is presented on the Call stacks/Methods page. Additionally, you can view information about the native memory of the snapshot under the Native memory page.
If automatic saving of snapshots is enabled, then the snapshot will be saved in a temporary profiler session file, allowing you to use the collected snapshot as a comparison for subsequent snapshots. If automatic saving of snapshots is not enabled, you will need to use the Save snapshot command to be able use the snapshot for later comparison. For more information about automatically saving snapshots, see Session Settings.
As long as the application is running, you can collect additional heap snapshots. Each snapshot is automatically compared with the previous one, but you can compare any two snapshots by using the Show snapshot and the Comparison snapshot dropdown lists. This provides you with information about the memory allocations performed between two snapshots.
When you are done profiling select the **Stop **command. You will be given the opportunity to save the profiler session to disk.