开发者

StructureMap ObjectFactory.Reset memory leak?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜