Class VhTypeTracker
Provides a process-wide tracker of objects and events for memory investigations: it counts, by name, the objects it was given that are still alive, and counts named events.
public static class VhTypeTracker
- Inheritance
-
VhTypeTracker
- Inherited Members
Remarks
It does nothing until Enabled. Each call takes a lock, so it is no tool for production paths.
Properties
Enabled
Gets or sets a value indicating whether the tracker records. Turning it on clears what was recorded before.
public static bool Enabled { get; set; }
Property Value
Methods
GetSnapshotString()
Returns the tracked objects still alive, counted by name, a task's split into its completed and active ones, and the event counts.
public static string GetSnapshotString()
Returns
- string
One line, such as
live=[Name:3] events=[Name.created:5].
Record(string)
Counts an event.
public static void Record(string eventName)
Parameters
eventNamestringThe event's name.
Track(object)
Tracks an object under its type's name, holding it weakly, and counts its creation.
public static bool Track(object obj)
Parameters
objobjectThe object.
Returns
Track(object?, string)
Tracks an object under a name, holding it weakly, and counts the event name.created.
public static bool Track(object? obj, string diagnosticName)