是否有垃圾收集器的任何配置? [英] Is there any configuration for the garbage collector?

查看:137
本文介绍了是否有垃圾收集器的任何配置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,垃圾收集器调整isself应用程序运行时,使用例如门限,当收集在托管堆中的对象进行调整(根据MSDN)随着时间的推移。

As I understand it, the garbage collector adjusts isself as the application runs, the threshhold used for example, when objects on the managed heaps are collected is adjusted (according to MSDN) over time.

如果一个应用程序崩溃,并在运行时记住它的previous垃圾收集的设置或任何其他的设置吗?

If an application crashes, does the runtime remember it's previous garbage collection 'settings' or any other settings?

推荐答案

是的,有一个在垃圾收集算法,使得它会自动调整分配策​​略启发式。这方面最明显的副作用是看到了代0堆大小成长为程序运行并占用内存。通常开始于2 MB,就可以得到〜8 MB如果程序迅速消耗内存。在可见的Perfmon.exe性能计数器是很好的。

Yes, there's a heuristic in the garbage collector algorithm that makes it automatically adjust the allocation strategy. The most visible side-effect of this is seeing the gen 0 heap size growing as the program is running and consuming memory. Typically starts at 2 MB, it can get to ~8 MB if the program consumes memory rapidly. The performance counters visible in Perfmon.exe are good for this.

重点是非常多的自动,这code写的单位出假设程序员没有向他们提供足够的信息来正确引导的算法。唯一的钩子的东西,GC不能知道的,像非托管的内存使用情况(GC.AddMemory pressure)或程序(app.exe.config)的作用。

The emphasis is very much on "automatic", this code was written with the flat-out assumption that programmers don't have enough information available to them to properly steer the algorithm. The only "hooks" are stuff that the GC cannot know about, like unmanaged memory usage (GC.AddMemoryPressure) or the role of the program (app.exe.config).

启发式的细节没有记录。但是,您可以搜集从今天的出版社的一些背景信息的软件算法文档,美国专利局。大多数微软的GC算法专利被记入帕特里克Dussud,你可以很容易地找到他们回来对他的名字谷歌查询。这里是相关之一。

The details of the heuristic are not documented. However, you can glean some background info from today's publishing house for software algorithm documentation, the US Patent Office. Most of Microsoft's GC algorithms patents are credited to Patrick Dussud, you can easily find them back with a google query on his name. Here's a relevant one.

这篇关于是否有垃圾收集器的任何配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆