Performs a full snapshot of the garbage collected heap, reports it to .NET Memory Profiler
and returns a MemSnapShot that can
be used in subsequent calls to the MemAssertion methods.
Overload List
| Name | Description | |
|---|---|---|
|
|
FullSnapShot()()()() |
Collects a full snapshot and allows allows .NET Memory Profiler to assign a default
name to the snapshot.
|
|
|
FullSnapShot(String) |
Collects a full snapshot and provides the name of the snapshot.
|
Remarks
If the current process is attached to the profiler, a full heap snapshot will be performed and
a MemSnapShot instance representing the state of
the GC heap after the collection will be returned.
A full heap snapshot includes several generation #2 garbage collections, and waiting for finalizers to finish. Additionally, the full snapshot will be reported to .NET Memory Profiler which will automatically save the snapshot. Thus, this method should only be called if the snapshot is needed for analysing the GC heap using .NET Memory Profiler. To get a snapshot to be used as a reference for memory assertions, use FastSnapShot()()()() instead.
The returned MemSnapShot can be used as a reference snapshot in subsequent calls to the MemAssertion methods.If the current process is not currently being profiled, this method does nothing and returns Empty
Examples
void ReportHeapStatus()
{
// Collect a full heap snapshot that can be analysed using .NET Memory Profiler.
MemProfiler.FullSnapShot();
}
|