可用的CLR垃圾收集器频率和系统内存 [英] CLR Garbage Collector frequency and system memory available

查看:110
本文介绍了可用的CLR垃圾收集器频率和系统内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个具有300MB可用物理内存和6个.NET进程的系统。当资源可用时,它们中的每一个都可以从空闲的100MB跃升到500MB的压力。我知道必须增加系统规格,但我想知道GC是否会尝试更频繁地收集内存并尝试使进程的内存分配尽可能小? GC频率如何取决于可用的系统内存?

I have a system with 300MB of physical memory available and 6 .NET processes. Each of them can jump from 100MB in idle to 500MB in stress when resources are available. I know that system specs have to be increased but I wonder whether GC will try to collect memory more often and try to keep processes memory allocation as small as possible? Does\how GC frequency depend on system memory available?

我正在使用2.0运行时。

I'm using 2.0 runtime.

推荐答案

垃圾回收确实取决于系统内存。很懒这意味着如果有足够的可用空间,它将收集的频率降低。

Garbage collection indeed depends on the system memory. It's lazy. That means it will collect less often if there is enough free space anyway.

您可以详细阅读此处

对您来说最重要的一句话:

The most important sentence for you:


满足以下条件之一时即发生垃圾收集:

Garbage collection occurs when one of the following conditions is true:


  • 系统内存不足

如果您的总体内存较低,则显然更容易出现可用物理内存较低的情况。

If you have low overall memory, there will obviously be low free physical memory more often.

这篇关于可用的CLR垃圾收集器频率和系统内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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