CLR Garbage Collector frequency and system memory available

回眸只為那壹抹淺笑 提交于 2019-12-24 08:14:20

问题


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?

I'm using 2.0 runtime.


回答1:


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.

You can read up on the details here.

The most important sentence for you:

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

  • The system has low physical memory.

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



来源:https://stackoverflow.com/questions/22346548/clr-garbage-collector-frequency-and-system-memory-available

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!