You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have detected a memory leak with NInject 3.3.6
This would have been solved with last changes for 4.0.0-beta but I think important to report it.
It's depending on the context but it is easily reproducible.
Just make sure about both conditions :
The element was not previously registered
The resolve is tried about a concrete type (not an interface)
using System;
using System.Diagnostics;
using System.Threading;
using Ninject;
namespace NInjectMemoryLeak;
/// <summary>
/// Program
/// </summary>
public static class Program
{
public static void Main()
{
using var container = new StandardKernel();
for (var i = 0; i < int.MaxValue; i++)
{
var watch = Stopwatch.StartNew();
container.TryGet<object>("toto");
var duration = watch.Elapsed;
Console.WriteLine($"{i} => {duration}");
if (i % 1000 == 0)
{
GC.Collect();
Thread.Sleep(1000);
}
}
Console.Read();
}
}
You will have good perf at first
but a memory leak occurs and performance decreases
[...]
Hi NInject Team,
We have detected a memory leak with NInject 3.3.6
This would have been solved with last changes for 4.0.0-beta but I think important to report it.
It's depending on the context but it is easily reproducible.
Just make sure about both conditions :
You will have good perf at first
but a memory leak occurs and performance decreases
[...]
And this seems to be because of missing bindings adds
The text was updated successfully, but these errors were encountered: