Method GetMemoryUsage
GetMemoryUsage(MemSnapshot)
Gets information about the managed memory usage that has occurred since the specified base snapshot.
Declaration
public static MemoryUsage GetMemoryUsage(MemSnapshot baseSnapshot)
Parameters
Type | Name | Description |
---|---|---|
MemSnapshot | baseSnapshot | Snapshot that is used as the base for the memory usage information. |
Returns
Type | Description |
---|---|
MemoryUsage | Memory usage information |
Remarks
The memory usage includes information about all memory activity that has occurred since the base snapshot until the call of this method, unless there is currently an active assertions session. If there is an active assertions session, then memory activity is only included until the previous call to BeginAssertions().
If profiling is not active, this method will return null
.
GetMemoryUsage()
Gets information about the managed memory usage that has occurred since the last stored snapshot, or since the start of the process if no snapshot is stored.
Declaration
public static MemoryUsage GetMemoryUsage()
Returns
Type | Description |
---|---|
MemoryUsage | Memory usage information |
Remarks
A snapshot is stored if the storeAsBaseSnapshot
parameter is true in a call to FastSnapshot(Boolean) or MemProfiler.FullSnapshot. However,
it is recommended that the base snapshot is specified by using the GetMemoryUsage(MemSnapshot) overload instead.
The memory usage includes information about all memory activity that has occurred since the base snapshot until the call of this method, unless there is currently an active assertions session. If there is an active assertions session, then memory activity is only included until the previous call to BeginAssertions().
If profiling is not active, this method will return null
.