Open JanEggers opened 7 months ago
another Root seems to be a Timer in DefaultHttpClientFactory
another Root seems to be a Timer in DefaultHttpClientFactory
That's internal to DefaultHttpClientFactory
itself: code.
It's going to keep running until it's satisfied that there's no handlers in active use. If you think that's the case and it's still running for no reason, then that's an issue to file over in the dotnet/runtime repository.
for me the mayor issue seems to be that there is some kind of policy missing that ensures that all classes that store delegates for whatever reason need to implement IDisposable and clear the delegates during dispose
@JanEggers Can you please provide a small repro program demonstrating the issue? Probably, this would look like a single test followed by the cleanup you were expecting to free the memory. Thanks!
Is there an existing issue for this?
Describe the bug
When running integrationtests memory usage accumulates besides the WebApplication is disposed.
there are also a bunch of classes kept alive by service provider internals again my pov is that when the webapplication is disposed everything should be cleaned up. I can see the serviceProvider is disposed but it still contains a buch of stuff that keeps objects alive.
I tried to manually cleanup stuff which improved the situation but not really cleaned it up all the way there are still classes that are kept by for example som DFAMatcher
here is my code I use to improve dispose behavior. Im not sure which are sideffects and should be gone automatically once the webapplication is no longer kept alive but its hard to see if this kind of large objects are kept alive.
Expected Behavior
Disposing the webapplication should free all related Memory.
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
8.0.2
Anything else?
No response