.NET 4 GC称为阈值触发采集?阈值、NET、GC

2023-09-04 12:16:09 作者:C’est mon seul 这是我唯一的坚定

我知道,GC触发逻辑并不简单,但它具有一定的阈值来监视。

I know that the logic for GC to trigger is not simple but it has certain thresholds to monitor.

任何人都知道什么是这些门槛可能是.NET 4工作站和服务器GC?

Anyone knows what are these thresholds could be for .NET 4 workstation and server GC ?

感谢您

推荐答案

有没有设置门槛,他们动态变化的垃圾收集器在更进一步了解该计划的分配模式。有没有办法让你发现目前的门槛,也无法改变它。从平时的观察,似乎工作站GC开始时用一个2兆根0堆。它可以长到超过8兆字节。

There are no set thresholds, they dynamically change as the garbage collector learns more about the program's allocation pattern. There is no way for you to discover the current threshold, nor to change it. From casual observation, it appears workstation GC starts out with a 2 megabyte gen 0 heap. Which can grow to over 8 megabytes.

服务器GC是工作站完全不同,它通常使用较大的阈值和多线程来收集垃圾。同样,没有什么可以发现,除了通过观察性能计数器的Perfmon.exe

Server GC is quite different from workstation, it normally uses larger thresholds and multiple threads to collect garbage. Again, nothing you could discover, other than by observing the performance counters in Perfmon.exe