Share via


GCSettings.IsServerGC Proprietà

Definizione

Ottiene un valore che indica se la procedura di Garbage Collection del server è abilitata.

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

Valore della proprietà

true se la procedura di Garbage Collection del server è attivata; in caso contrario, false.

Esempio

L'esempio seguente indica se il computer host usa server o workstation Garbage Collection.

using System;
using System.Runtime;

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

        if (GCSettings.IsServerGC)
            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.

Commenti

Per informazioni sulla Garbage Collection server, vedere Workstation e Server Garbage Collection.

Se il server Garbage Collection non è abilitato, workstation Garbage Collection è effettivo (con o senza raccolta simultanea). La Garbage Collection server è disponibile solo nei computer multiprocessore.

Un host non gestito può richiedere Garbage Collection del server e la richiesta host esegue l'override delle impostazioni dei file di configurazione. Se l'host non specifica il tipo di Garbage Collection, è possibile usare un'impostazione di configurazione per specificare Garbage Collection del server. Per altre informazioni, vedere Configurare workstation e server.

Si applica a