EntityFramework.DynamicFilters have Memory Leakage
yadav-dhananjay opened this issue · 3 comments
That ConcurrentDictionary you are showing is used to cache parameter values that are scoped to specific DbContext instances. That is why DbContext is used as the key. When that is done, an event is registered on the OnDisposing() method of the DbContext to clean it up. I just verified that this is still working in my unit tests.
So can you verify that you are disposing your DbContext instances when you are finished with them?
You can also download the source, reference that instead of the NuGet package, and then stick a break point in the DynamicFilterExtensions.ClearScopedParameters() method. That should get hit when you call Dispose on your DbContext instance. Verify that happens when you manually call Dispose to see that it work. Then see if it's getting hit during your normal application execution. If it gets hit when you force a Dispose but not during normal execution, then your DbContext instances are not being disposed of properly.
@jcachat I am facing the same issue.
My setup: DBContext that inherits EntityFramework DataContext
i use Using() statements everywhere, so could it still be a Disposing issue?
@yadav-dhananjay do you have any info on how you fixed this?