Class MemoryDebug
- Namespace
- SunamoDebugging
- Assembly
- SunamoDebugging.dll
Provides debugging utilities for tracking memory allocation over time.
public class MemoryDebug
- Inheritance
-
MemoryDebug
- Inherited Members
- Extension Methods
Properties
AllocatedMemoryWriter
Gets or sets the StreamWriter used to log memory values to a file.
public static StreamWriter? AllocatedMemoryWriter { get; set; }
Property Value
Initialized
Gets or sets a value indicating whether the MemoryDebug class has been initialized.
public static bool Initialized { get; set; }
Property Value
Methods
Init(string)
Initializes the memory debug logging system by creating a log file in the specified directory.
public static void Init(string directoryPath)
Parameters
directoryPathstringThe directory path where the AllocatedMemory.txt log file will be created.
OverallConsumedByThisMethod()
Calculates the overall memory consumed between the first and last recorded memory values. This method is intended for debugging purposes to track memory consumption in a method.
public static long OverallConsumedByThisMethod()
Returns
- long
The difference in bytes between the last and first memory values.
WriteLine(long)
Writes a memory value to the log file and updates internal tracking.
public static void WriteLine(long memoryValue)
Parameters
memoryValuelongThe memory value in bytes to log.