gpt4 book ai didi

c# - StructureMap ObjectFactory.Reset 内存泄漏?

转载 作者:行者123 更新时间:2023-11-30 18:44:45 28 4
gpt4 key购买 nike

这是重现问题的简单测试,这是整个项目中的单个类,没有其他引用:

[TestFixture]
public class ObjectFactoryTests
{
[Test]
public void ResetMemoryLeak()
{
for (int i = 1; i < 1000; i++)
{
ObjectFactory.Reset();
if (i % 10 == 0)
{
GC.Collect();
GC.WaitForFullGCComplete();
Console.WriteLine(GC.GetTotalMemory(true));
}
}
}
}

产出稳步增长:

498720
509668
...
794072
796952

谁知道可能是什么问题?

最佳答案

似乎升级到 StructureMap 2.6.1 解决了这个问题。

关于c# - StructureMap ObjectFactory.Reset 内存泄漏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2370301/

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