views:

116

answers:

1

Here's the simple test to reproduce the issue, 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?

A: 

Seems that upgrade to StructureMap 2.6.1 solved this issue.

Pawel Lesnikowski