dotTrace 2019.2 Help

.NET Memory Allocations

When .NET Memory Allocations is selected in the Events filter, Timeline Viewer shows you how your application allocated memory to the managed heap. For example, Call Tree shows how much memory (in MB) a particular call has allocated.

Select the .NET Memory Allocations event for analyzing excessive memory traffic and garbage collections. The latter are one of the main reasons of UI freezes as the main thread can be suspended during a GC.

Note that allocation point event is raised only after the size of allocated memory exceeds 100 KB in total. For example, a thread allocates five 50 KB memory blocks during profiling. In such a case, dotTrace will detect only two allocations of 100 KB.

memory allocation 1

When you select the .NET Memory Allocations subject, Timeline Viewer adds the auxiliary .NET Memory Allocations: Heap filter to the Filters window.

.NET Memory Allocations: Heap

The .NET Memory Allocations: Heap sub-filter is used to show distribution of allocated memory between small and large object heaps. The info about allocations to LOH allows you to evaluate how your application uses large data collections. This can be important for performance analysis as LOH is not automatically compacted and becomes fragmented over time.

As a filter, .NET Memory Allocations: Heap can be used to filter out point events where allocation to a certain heap takes place. For example, if you want to determine methods that allocate memory in LOH, select .NET Memory Allocations in the Events filter and Large Object Heap in .NET Memory Allocations: Heap. The methods will be shown in the Call Stack window in Methods and Subsystems.

memory allocation 2

pos 1 Heap name: Small Object Heap or Large Object Heap.

pos 2 The size of objects allocated in the heap.

pos 3 The percentage of size of objects allocated in the heap relative to the total allocated memory.

For example, your application has two threads: Thread#1 and Thread#2. During profiling, Thread#1 allocated 8 MB to SOH and 1 MB to LOH. Thread#2 allocated 1 MB to LOH. The Events filter for these two threads will look like follows:

...
.NET Memory Allocations 10 MB
...

The .NET Memory Allocations: Heap filter will look like follows:

Small Object Heap 8 MB 80.00%
Large Object Heap 2 MB 20.00%

To apply the .NET Memory Allocations: Heap filter

  • Select the desired heap(s) in the filter.

After you select a heap, other filters will show only the point events where allocation to the selected heap took place. For example, Top Methods in the Call Stack window will show the list of methods that allocated objects in the heap.

memory allocation heap 2

.NET Memory Allocations: Type

The .NET Memory Allocations: Type sub-filter is used to show distribution of allocated memory between objects of a certain type. This info may help you to identify types of allocated objects on a selected timeframe.

As a filter, .NET Memory Allocations: Type can be used to filter out point events where objects of a certain type are allocated. For example, if you want to determine methods that allocate strings, select .NET Memory Allocations in the Events filter and System.String in .NET Memory Allocations: Type. The methods will be shown in the Call Stack window in Methods and Subsystems.

memory allocation type

pos 1 Type name.

pos 2 The size of objects.

pos 3 The percentage of size of objects of a certain type relative to the total allocated memory.

To apply the .NET Memory Allocations: Type filter

  • Select the desired type(s) in the filter.

After you select a type, other filters will show only the point events where allocation of objects of this type took place. For example, Top Methods in the Call Stack window will show the list of methods that allocated objects of the selected type.

memory allocation type filter
Last modified: 8 August 2019