GC.EndNoGCRegion Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Ends the no GC region latency mode.
public:
static void EndNoGCRegion();
public static void EndNoGCRegion ();
[System.Security.SecurityCritical]
public static void EndNoGCRegion ();
static member EndNoGCRegion : unit -> unit
[<System.Security.SecurityCritical>]
static member EndNoGCRegion : unit -> unit
Public Shared Sub EndNoGCRegion ()
- Attributes
Exceptions
The garbage collector is not in no GC region latency mode.
-or-
The no GC region latency mode was ended previously because a garbage collection was induced.
-or-
A memory allocation exceeded the amount specified in the call to the TryStartNoGCRegion(Int64) method.
Remarks
The EndNoGCRegion method throws an InvalidOperationException if the garbage collector is not in no GC region latency mode. This occurs under any of the following conditions:
The TryStartNoGCRegion method was not called previously.
The call to the TryStartNoGCRegion method returned
false
.The call to the TryStartNoGCRegion method threw an exception.
You can prevent an exception for any of these reasons by using code such as the following:
if (GCSettings.LatencyMode == GCLatencyMode.NoGCRegion)
GC.EndNoGCRegion();
if GCSettings.LatencyMode = GCLatencyMode.NoGCRegion then
GC.EndNoGCRegion()
If GCSettings.LatencyMode = GCLatencyMode.NoGCRegion Then
GC.EndNoGCRegion()
End If
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기