StructureMap ObjectFactory.Reset memory leak?

Here's a simple test to reproduce the problem, this is the only class in the entire project, and there are no other links:

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

The output shows steady growth:

498720
509668
...
794072
796952

Does anyone know what the problem is?

+3
source share
1 answer

It seems that updating to StructureMap 2.6.1 has solved this problem.

0
source

Source: https://habr.com/ru/post/1735207/


All Articles