How to focus on a subsystem in a dotTrace snapshot?

After dotTrace has recorded some profiling data on your application, it presents it in the form of a snapshot. Everything you want to know about your application is stored in the snapshot and can be viewed in dotTrace. However, the wealth of data presented in one snapshot can sometimes be overwhelming. To analyze the data efficiently, you will need to focus on a subsystem, and probably more than once.
In performance snapshots, a subsystem is a branch of the function call tree. After you have selected the function you want to inspect in more detail, you can quickly open it in a new separate tab. To do so, select the function and press Ctrl + T, or right-click the node and select Open in New Tab from the context menu.
In case you know what function you are looking for, but haven’t yet located it in a view, you can quickly search for it. Press Ctrl + F to search for a function by name:
Find the function you want to inspect closer
After you locate the desired function, click Open in New Tab.
Once a function is opened in its own tab, the percentages calculated for each node you see become more relevant. They are calculated with respect to the new root node – not as a percentage of all CPU time.
In addition, opening a function in a separate tab lets you switch to the Back Traces view. The Back Traces view lists all the callpaths that led to a function. Thus, you are able to see which callpaths contributed the most to the time consumed by the function.
In memory snapshots, however, a subsystem can be one of many things. It can be:

  • an object
  • a class
  • a namespace
  • a root (Stack, Finalizer, Garbage Collector Handle, Application Domain Static, or Thread Static)

Which subsystem you should focus on depends on your goals. You may want to focus on a particular namespace to examine the memory consumption patterns of its classes. You may also want to focus on a particular class to see what objects it creates and how they consume memory. If you focus on an object, you can get a reverse view – see its Incoming References. Also, you can focus on a root, such as Finalizer, to see how objects are finalized in your code.
To open either of these entities in its individual tab, select it and press Ctrl + T, or right-click the node and select Open in New Tab from the context menu.
The bottomline of the story is: Don’t try to process too much information at once! Use the divide-and-conquer strategy – focus on a subsystem!

Technorati tags: profiling, dotTrace, .NET
image description