C#GC for Server

Edw*_*d83 3 c# garbage-collection .net-4.0

.Net 4.0中是否提供Server GC(配置中的gcServer标志)?或者它被弃用了?

谢谢!!!

xan*_*tos 7

是的,它(仍然可用).不,它不是(已弃用).

为什么这样问?

参数http://architecturebyashwani.blogspot.com/2010/02/foreground-gc-and-background-gc.html上的链接

在4.0中甚至有一个新的GC(工作站模式的背景),所以最后有三个GC; 服务器,工作站并发,工作站并发关闭.

web.config/ 的三个设置app.config是:

<configuration> 
    <runtime> 
        <gcConcurrent enabled="false"/> 
<!-- or -->
        <gcConcurrent enabled="true"/> 
<!-- or -->
        <gcServer enabled="true"/> 
    </runtime> 
</configuration> 
Run Code Online (Sandbox Code Playgroud)

这三者or是"独家".您一次只能启用一个选项:-)

  • 从4.5开始,您可以启用两者 (2认同)