-
Notifications
You must be signed in to change notification settings - Fork 770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ConfigurationProviders leak memory #861
Comments
Just wondering if this would be the way we would solve this:
If that’s correct, I would be interested to pick this up. Since the configuration is also used in the |
Yes.
Yes
This should happen for free since the ConfigurationRoot is in the container. |
But doesn’t aspnet/DependencyInjection#462 prevent the configuration root from getting disposed since it is being registered as an instance? |
Ah, yes you're right! We need to do the same for the hosting environment as well. |
You mean make HostingEnvironment disposable and dispose the two file providers? Or maybe dispose of those manually (maybe through an extension method) since the hosting environment itself is just a POCO while an extension method does the actual work? Also, since we agree to dispose the configuration root manually now, what is your opinion on disposing the original configuration root inside the web host builder? Looking at how it is used (and how the web host builder just allows to be built once), I guess we could also dispose the config after the web host is being built and forward |
Fixed |
@davidfowl We still need the work on the AspNetCore side though. I'm working on that (currently struggling with getting the repo to build). |
@poke We actually need it in 2 places. It needs to go into the generic host (that's the default in 3.0) and in the WebHost for compat. |
This roots tons of objects because of #786 they can't be cleaned up.
The text was updated successfully, but these errors were encountered: