GCSettings.IsServerGC Özellik
Tanım
Sunucu çöp toplamanın etkin olup olmadığını gösteren bir değer alır.Gets a value that indicates whether server garbage collection is enabled.
public:
static property bool IsServerGC { bool get(); };
public static bool IsServerGC { get; }
member this.IsServerGC : bool
Public Shared ReadOnly Property IsServerGC As Boolean
Özellik Değeri
true Sunucu çöp toplama etkinse; Aksi takdirde, false .true if server garbage collection is enabled; otherwise, false.
Örnekler
Aşağıdaki örnek, konak bilgisayarın sunucu veya iş istasyonu çöp toplamayı kullanıp kullanmadığını belirtir.The following example indicates whether the host computer is using server or workstation garbage collection.
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.
Açıklamalar
Sunucu çöp toplama hakkında daha fazla bilgi için bkz. çöp toplamanın temellerihakkında "iş Istasyonu ve sunucu çöp toplama" bölümü.For information about server garbage collection, see the "Workstation and Server Garbage Collection" section in Fundamentals of Garbage Collection.
Sunucu çöp toplama etkin değilse, iş istasyonu atık toplama etkin olur (eşzamanlı koleksiyon ile veya olmadan).If server garbage collection is not enabled, workstation garbage collection is in effect (with or without concurrent collection). Sunucu çöp toplama yalnızca çok işlemcili bilgisayarlarda kullanılabilir.Server garbage collection is available only on multiprocessor computers.
Yönetilmeyen bir konak, sunucu çöp toplama isteğinde bulunabilir ve konak isteği yapılandırma dosyası ayarlarını geçersiz kılar.An unmanaged host can request server garbage collection, and the host request overrides configuration file settings. Konak çöp toplama türünü belirtmezse, sunucu çöp toplamayı belirtmek için bir yapılandırma dosyası ayarı kullanabilirsiniz.If the host does not specify the type of garbage collection, you can use a configuration file setting to specify server garbage collection. Bu ayar, makine yapılandırma dosyasında değil, yalnızca uygulama yapılandırma dosyasında geçerlidir (bkz. uygulamaları yapılandırma).This setting is valid only in the application configuration file, not in the machine configuration file (see Configuring Apps). Aşağıdaki örnek, sunucu çöp toplamayı sağlayan örnek bir uygulama yapılandırma dosyasının içeriğini gösterir.The following example shows the contents of a sample application configuration file that enables server garbage collection.
<configuration>
<runtime>
<gcServer enabled="true" />
</runtime>
</configuration>