Why EF Core 2.2.6 does not garbage collect?
问题 I am using the dotMemoryUnit to prove the my DbContext object is getting garbage collected properly. I feel that this code should work properly in a unit test, but the test always fails. The only thing I can guess is EF Core is holding a reference somewhere. Edit: I'm not sure the suggested question addresses this problem as this is .Net Core and not .Net Framework. The documentation for GC.Collect()'s default is forced and the documentation says nothing about hints. Edit 2: I did find the