.Net 4 垃圾收集
我最近尝试阅读 Java 和 .Net 中的垃圾收集算法。到目前为止,我发现java在其收集器中使用Mark和Sweep作为算法。
.Net 是否在所有世代中都使用 Mark 和 Sweep?
Microsoft 是如何从并发 G0、G1 收集器(与 G@ 收集器串行运行)转变为所谓的后台 GC(一切都是并行的)?
预先感谢您的回答。
I tried to read up garbage collection algorithms in Java and in .Net recently. So far I found out that java uses Mark and Sweep as algorithm within its collectors.
Is .Net using Mark and sweep as well on all the generations?
How did Microsoft moved from concurrent G0, G1 collector, running SERIALLY with G@ collector, to a sth called BACKGROUND GC, where everything is parallel?
Thanks in advance for your answers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
.NET GC 是一种标记和清除垃圾收集器。
后台 GC 意味着您可以在应用程序运行时执行 Gen2 GC。如果您的应用程序是分配密集型的,并且后台 GC 无法为新分配释放足够的空间,则 BGC 收集器将停止,并且使用 stop-the-world 收集器来执行完整的 Gen2 GC(这可能会导致压缩堆,或扩展它)
希望这有帮助
.NET GC is a mark and sweep garbage collector.
Background GC means that you can perform Gen2 GCs while your application is running. If your application is allocation intensive, and the background GC can't free up enough space for the new allocation, the BGC collector is stopped, and a stop-the-world collector is used to do a full Gen2 GC (which could result in compacting the heap, or expanding it)
Hope this helps