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?