Dynamo.IoC
Dynamo.IoC copied to clipboard
Potential memory leak
If container is initialized with CompileMode.Dynamic the used memory is continuously growing. With CompileMode.Delegate this does not happen.
You should be able to reproduce with this sample code:
class Program
{
static void Main(string[] args)
{
while (true)
{
var container = new IocContainer(defaultCompileMode: CompileMode.Dynamic);
container.Register<ITransient, Transient>();
container.Compile();
container.Dispose();
}
}
}
public interface ITransient
{
void DoSomething();
}
public class Transient : ITransient
{
public void DoSomething()
{
Console.WriteLine("Hello");
}
}