Class OdfMemoryTracker
Provides the OdfMemoryTracker API. 未受控記憶體安全生命週期追蹤器 (Unmanaged Memory Leak Tracker)。
public static class OdfMemoryTracker
- Inheritance
-
OdfMemoryTracker
- Inherited Members
Properties
BoxingWarningThreshold
Gets the BoxingWarningThreshold value. 取得或設定高頻 boxing 估計次數警示門檻。
public static long BoxingWarningThreshold { get; set; }
Property Value
DiagnosticsEnabled
Gets a value indicating the DiagnosticsEnabled state. 取得或設定是否啟用記憶體與反模式診斷警示。
public static bool DiagnosticsEnabled { get; set; }
Property Value
LargeAllocationWarningThresholdBytes
Gets the LargeAllocationWarningThresholdBytes value. 取得或設定單次分配大小警示門檻;預設對齊 .NET LOH 常見門檻。
public static long LargeAllocationWarningThresholdBytes { get; set; }
Property Value
NodeLoadWarningThreshold
Gets the NodeLoadWarningThreshold value. 取得或設定單次載入節點數警示門檻。
public static long NodeLoadWarningThreshold { get; set; }
Property Value
TotalTrackedMemoryWarningThresholdBytes
Gets the TotalTrackedMemoryWarningThresholdBytes value. 取得或設定累計追蹤記憶體警示門檻。
public static long TotalTrackedMemoryWarningThresholdBytes { get; set; }
Property Value
TrackedAllocationCountWarningThreshold
Gets the TrackedAllocationCountWarningThreshold value. 取得或設定追蹤分配數量警示門檻。
public static int TrackedAllocationCountWarningThreshold { get; set; }
Property Value
Methods
CheckLeaks()
Short overload of CheckLeaks that uses default values for all optional parameters and forwards to the full overload. 便利多載:CheckLeaks 的所有可選參數使用預設值並轉呼叫最長多載。
public static bool CheckLeaks()
Returns
CheckLeaks(bool)
Performs check leaks. 檢查是否有尚未釋放的非受控記憶體。
public static bool CheckLeaks(bool reportLeaks)
Parameters
reportLeaksbool是否列印洩漏報告
Returns
- bool
是否有洩漏
ReportLoadProfile(long)
Short overload of ReportLoadProfile that accepts nodeCount; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 nodeCount;其餘可選參數使用預設值並轉呼叫最長 ReportLoadProfile 多載。
public static void ReportLoadProfile(long nodeCount)
Parameters
nodeCountlong
ReportLoadProfile(long, long?)
Short overload of ReportLoadProfile that accepts nodeCount and allocatedBytes; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 nodeCount 與 allocatedBytes;其餘可選參數使用預設值並轉呼叫最長 ReportLoadProfile 多載。
public static void ReportLoadProfile(long nodeCount, long? allocatedBytes)
Parameters
ReportLoadProfile(long, long?, long)
Short overload of ReportLoadProfile that accepts nodeCount, allocatedBytes, and boxedValueCount; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 nodeCount、allocatedBytes 與 boxedValueCount;其餘可選參數使用預設值並轉呼叫最長 ReportLoadProfile 多載。
public static void ReportLoadProfile(long nodeCount, long? allocatedBytes, long boxedValueCount)
Parameters
ReportLoadProfile(long, long?, long, string?)
Performs report load profile. 回報單次載入或批次操作的記憶體與反模式特徵,超過門檻時輸出診斷警示。
public static void ReportLoadProfile(long nodeCount, long? allocatedBytes, long boxedValueCount, string? label)
Parameters
nodeCountlong本次載入或操作涉及的 DOM 節點數
allocatedByteslong?本次載入或操作估計配置的位元組數;未知時可為 null
boxedValueCountlong本次操作估計發生的 boxing 次數
labelstring選用的情境標籤
Track(nint, long)
Short overload of Track that accepts ptr and size; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 ptr 與 size;其餘可選參數使用預設值並轉呼叫最長 Track 多載。
public static void Track(nint ptr, long size)
Parameters
Track(nint, long, string?)
Performs track. 追蹤非受控記憶體或 POH 鎖定分配。
public static void Track(nint ptr, long size, string? label)
Parameters
Untrack(nint)
Performs untrack. 取消追蹤並釋放非受控記憶體。
public static void Untrack(nint ptr)
Parameters
ptrnint記憶體區塊指標