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.
精彩评论