Group by Similar Retention
The Group by Similar Retention view groups objects by similarity of their retention paths. For each object set, the view shows two shortest paths to roots. Note that from the whole variety of shortest paths, dotMemory selects only two paths that are most different from each other.
The Group by Similar Retention view allows you to distinguish where the objects of the same type logically belong to. For example, it's obvious that a number of int variables in an array will have the same retention path which is different to variables of any other int array.
You can also use Group by Similar Retention to identify why an object is still in memory. For example, it may be useful when investigating potential memory leaks caused by objects retained on more than one path (see Group by Dominators for details).
The list of objects for which graph is built consists of the following columns:
Name | Description |
---|---|
Type | Type name. |
Objects count | The number of objects with the same retention path. |
Bytes | The overall size of objects in bytes. |
Example
Filtering Objects
You can filter out objects that are of no interest for your analysis.
To narrow the list
- Start typing the desired type name in the Filter field.
dotMemory will exclude all instances that don't match the pattern.
You can make your search more efficient by using the following tips:
Use CamelHumps. E.g.
fo
will return objects of bothSystem.Drawing.Font
andMS.Utility.FrugalObjectList
types.Use special symbols, like wildcards and others. The full list is shown in the table below.
Symbol | Description | Example |
---|---|---|
* | Wildcard | * All objects in the set |
sys.*.data All types and namespaces that match the pattern. E.g. System.Data , System.Windows.Controls.Datagrid , and System.Windows.Data.Binding . | ||
sys.*.data. Only namespaces that match the pattern. E.g. System.Windows.Data.Binding but not System.Windows.Controls.Datagrid . | ||
Arrays | ||
[] | Leave only arrays | str[] Arrays, containing str in their type or namespace. E.g. String[] . |
[, [,, ... or [,] [,,] ... | Leave only arrays of the specified or higher (if brackets are not closed) dimension | str[,, Arrays with the dimension 3 and higher containing str in their type or namespace. E.g. String[,,] and String[,,,] . |
str[,,] Three-dimensional arrays containing str in their type or namespace. E.g. String[,,] . | ||
!a | Exclude arrays from the result | !a str Objects (excluding arrays) containing str in their type or namespace. E.g. String but not String[] . |
Generic type arguments | ||
< | Leave only types with generic type arguments | str< Only objects containing str in their type or namespace and having generic type arguments. E.g. FileStreamStorage<Char> but not List<String> . |
<str Only objects containing str in their generic type arguments. E.g. List<String> but not FileStreamStorage<Char> . | ||
<, <,, ... or <,> <,,> ... | Leave only objects with the specified number of generic type arguments | fun<,,> Objects containing fun in their type or namespace and having three generic type arguments. E.g. Func<String, Object, Object> . |
fun<str,,task Objects containing fun in their type or namespace and having three or generic type arguments that match the pattern. E.g. Func<Stream, IAsyncResult, TaskResult, EventArgs> . | ||
!g | Exclude generic type arguments from the search scope | !g str Objects (that do not have generic type arguments) containing str in their type or namespace. E.g. String but not List<String> . |
Selecting objects for further analysis
In the Group by Similar Retention view, you can select the following subjects for further analysis:
To select objects of a particular type retained in the same way
Double-click the corresponding type in the list.
After this, the [Type_name] with same retention paths subject will be added to the Analysis Path and the list of desired objects will be displayed in the Group by Types view.
To select the objects that are exclusively retained by the analyzed objects set
Click the Open objects retained by this set button.
After this, the Exclusively retained objects subject will be added to the Analysis Path and the list of desired objects will be displayed in the Group by Types view.