BackgroundService and dbcontext memory issue
I have a background service to update some objects.
And for about 10 minutes of running the service everything is fine, the application uses about 1 GB of RAM, but after that the memory starts growing to 4+ GB, I checked the largest object and it is Microsoft.EntityFrameworkCore.Query.Internal.BufferedDataReader+BufferedDataRecord
I checked this object, and there is by some objects, why?
here is my code of dbcontext instance and screenshots of the problem, I tried to use the temporary database context, but it doesn’t work, if you run the code through the controller using a timer, then everything is ok, so I suspect dbcontext + ef core
And for about 10 minutes of running the service everything is fine, the application uses about 1 GB of RAM, but after that the memory starts growing to 4+ GB, I checked the largest object and it is Microsoft.EntityFrameworkCore.Query.Internal.BufferedDataReader+BufferedDataRecord
I checked this object, and there is by some objects, why?
here is my code of dbcontext instance and screenshots of the problem, I tried to use the temporary database context, but it doesn’t work, if you run the code through the controller using a timer, then everything is ok, so I suspect dbcontext + ef core
using var scope = _scope.CreateScope();
using var context = scope.ServiceProvider.GetRequiredService<WebApiContext>();
