gpt4 book ai didi

c# - CLR 4.0 中的垃圾收集改进

转载 作者:太空狗 更新时间:2023-10-29 17:48:42 26 4
gpt4 key购买 nike

最近我正在运行 Andrew Hunter on his blog "The Dangers of the Large Object Heap" 提供的示例针对 .NET 4 编译,我得到以下数字:

With large blocks: 622Mb allocated
With large blocks, frequent garbage collections: 582Mb allocated
Only small blocks: 1803Mb allocated
With large blocks, large blocks not growing: 630Mb allocated

如果针对 .NET 2.0 编译相同的代码,我几乎得到文章中提到的数字:

With large blocks: 21Mb allocated
With large blocks, frequent garbage collections: 26Mb allocated
Only small blocks: 1811Mb allocated
With large blocks, large blocks not growing: 707Mb allocated

如此显着改善的原因是什么?

代码是为 x86 平台编译并在 Windows 7 上运行

最佳答案

CLR 团队的一些急需的工作是改进的原因,但显然仍有改进的空间:

http://mitch-wheat.blogspot.com/2010/11/net-clr-large-object-heap.html

关于c# - CLR 4.0 中的垃圾收集改进,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5412986/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com