GC.GetAllocatedBytesForCurrentThread 메서드

정의

수명 기간이 시작된 이후 현재 스레드에 할당된 바이트의 총 수를 가져옵니다.

public:
 static long GetAllocatedBytesForCurrentThread();
public static long GetAllocatedBytesForCurrentThread ();
static member GetAllocatedBytesForCurrentThread : unit -> int64
Public Shared Function GetAllocatedBytesForCurrentThread () As Long

반환

Int64

수명 기간이 시작된 이후 현재 스레드에 할당된 바이트의 총 수입니다.

설명

이 메서드는 GetAllocatedBytesForCurrentThread 가비지 수집을 유지한 총 바이트 수가 아니라 스레드 수명 동안 관리되는 힙에 할당된 총 바이트 수를 반환합니다. 반환된 값에는 네이티브 할당도 포함되지 않습니다.

이 방법은 시간 간격 또는 이벤트 간의 메모리 할당 차이를 측정하기 위한 모니터링 시나리오에서 가장 유용합니다.

적용 대상