GC.GetTotalAllocatedBytes(Boolean) 方法

定义

获取在进程生命周期内分配的字节计数。Gets a count of the bytes allocated over the lifetime of the process.

public static long GetTotalAllocatedBytes (bool precise = false);
static member GetTotalAllocatedBytes : bool -> int64
Public Shared Function GetTotalAllocatedBytes (Optional precise As Boolean = false) As Long

参数

precise
Boolean

如果为 true,则收集一个精确的数字;否则,收集近似计数。If true, gather a precise number; otherwise, gather an approximate count. 收集精确值会大大降低性能。Gathering a precise value entails a significant performance penalty.

返回

在进程生命周期内分配的总字节数。The total number of bytes allocated over the lifetime of the process.

适用于