开发者

StructureMap ObjectFactory.Reset memory leak?

开发者 https://www.devze.com 2022-12-21 23:13 出处:网络
Here\'s the simple test to reproduce the issu开发者_开发技巧e, this is the single class in the whole project and there are no other references:

Here's the simple test to reproduce the issu开发者_开发技巧e, this is the single class in the whole project and there are no other references:

[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));
            }
        }
    }
}

Output shows steady growth:

498720
509668
...
794072
796952

Anyone knows what might be the problem?


Seems that upgrade to StructureMap 2.6.1 solved this issue.

0

精彩评论

暂无评论...
验证码 换一张
取 消