API Reference
The profiling API
MemoryProfiler class methods
Item | Returns | Description |
---|---|---|
GetFeatures() | enum MemoryFeatures: uint | Returns a set of features currently active in the profiler: Bit flags in the
|
GetSnapshot() | Collect memory snapshot and save it to the disk. This method forces full garbage collection. | |
GetSnapshot(string name) | [Internal use only] | |
ForceGc() | Forces full garbage collection. | |
CollectAllocations(bool enable) | Enable/disable collecting memory allocation data. Does nothing if collecting allocation data is disabled in the profiler. To check whether the collecting is enabled, use | |
Detach() | Detach the profiler from the profiled process. Does nothing if detaching is disabled in the profiler. To check whether the detaching is enabled, use |
The self-profiling API
DotMemory class methods
Item | Returns | Description |
---|---|---|
EnsurePrerequisite(Uri nugetUrl = null, NuGetApi nugetApi = NuGetApi.V3, string downloadTo = null) | Initializes the profiler. This method is a simplified way to call the | |
EnsurePrerequisiteAsync(CancellationToken cancellationToken, IProgress<double> progress = null, Uri nugetUrl = null, NuGetApi nugetApi = NuGetApi.V3, string downloadTo = null) | Task | (We recommend that you use |
EnsurePrerequisiteAsync( CancellationToken cancellationToken, IProgress<double> progress = null, Uri nugetUrl = null, NuGetApi nugetApi = NuGetApi.V3, string downloadTo = null) | Task | (We recommend that you use |
GetSnapshotOnce() | Gets a memory snapshot using the default profiling configuration. | |
GetSnapshotOnce(DotMemory.Config config) | String | Gets a memory snapshot using the specified profiling |
Attach() | Attaches dotMemory to the current process using the default profiling configuration. | |
Attach(DotMemory.Config config) | Attaches dotMemory to the current process using the specified profiling | |
Detach() | String | Detaches dotMemory from the current process. Returns a string with the path to the saved snapshot (dotMemory workspace). |
GetSnapshot(string name = null) | String | Gets a memory snapshot. |
DotMemory.Config class methods
Item | Returns | Description |
---|---|---|
UseLogLevelTrace() | DotMemory.Config | Specifies TRACE log level. |
UseLogLevelVerbose() | DotMemory.Config | Specifies VERBOSE log level. |
UseLogFile(string filePath) | DotMemory.Config | Specifies the path to the log file. |
SaveToFile(string filePath, bool overwrite = false) | DotMemory.Config | Specifies the path to the workspace file (snapshots storage). |
SaveToDir(string dirPath) | DotMemory.Config | Specifies the path to the workspace directory (filename will be auto-generated). |
OpenDotMemory() | DotMemory.Config | Specifies whether to open the generated workspace in JetBrains dotMemory. |
WithCommandLineArgument(string argument) | DotMemory.Config | Appends an arbitrary argument to the command line as is (without any quoting, and so on). |
UseApi() | DotMemory.Config | (Advanced use only) |
DoNotUseApi() | DotMemory.Config | (Advanced use only) |