dotMemory
 
Get dotMemory

Control Profiling Session with API

Last modified: 26 May 2024

The profiling API provides a number of classes which allow you to control the profiling process. For example, right from the code of your application, you can:

  • get a memory snapshot: MemoryProfiler.GetSnapshot(string name),

  • enable or disable collecting memory allocation data: MemoryProfiler.CollectAllocations(bool enable),

  • and even force garbage collection: MemoryProfiler.ForceGc(),

For the detailed information about the API classes, refer to API Reference.

There are two main scenarios that require using the profiling API: