Share via


GCSettings.IsServerGC 속성

정의

서버 가비지 수집이 설정되었는지 여부를 나타내는 값을 가져옵니다.

public:
 static property bool IsServerGC { bool get(); };
public static bool IsServerGC { get; }
member this.IsServerGC : bool
Public Shared ReadOnly Property IsServerGC As Boolean

속성 값

Boolean

서버 가비지 수집이 설정되었으면 true이고, 그렇지 않으면 false입니다.

예제

다음 예제에서는 호스트 컴퓨터가 서버 또는 워크스테이션 가비지 수집을 사용하고 있는지 여부를 나타냅니다.

using System;
using System.Runtime;

class Sample
{
    public static void Main()
    {
        string result;

        if (GCSettings.IsServerGC == true)
            result = "server";
        else
            result = "workstation";
        Console.WriteLine("The {0} garbage collector is running.", result);
    }
}
// The example displays output like the following:
//      The workstation garbage collector is running.
Imports System.Runtime

Class Sample
   Public Shared Sub Main()
      Dim result As String
      
      If GCSettings.IsServerGC = True Then
         result = "server"
      Else
         result = "workstation"
      End If
      Console.WriteLine("The {0} garbage collector is running.", result)
   End Sub
End Class 
' The example displays output like the following:
'      The workstation garbage collector is running.

설명

서버 가비지 수집에 대한 자세한 내용은 워크스테이션 및 서버 가비지 수집을 참조하세요.

서버 가비지 수집을 사용하도록 설정하지 않으면 워크스테이션 가비지 수집이 적용됩니다(동시 수집 사용 여부). 서버 가비지 수집은 다중 프로세서 컴퓨터에서만 사용할 수 있습니다.

관리되지 않는 호스트는 서버 가비지 수집을 요청할 수 있으며 호스트 요청은 구성 파일 설정을 재정의합니다. 호스트가 가비지 수집 유형을 지정하지 않으면 구성 설정을 사용하여 서버 가비지 수집을 지정할 수 있습니다. 자세한 내용은 워크스테이션 및 서버 구성을 참조하세요.

적용 대상