ConfigurationProviders leak memory
See original GitHub issueusing System;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
namespace WebApplication45
{
public class Program
{
public static async Task Main(string[] args)
{
Console.WriteLine("STARTING");
Console.ReadLine();
CreateConfig();
Console.WriteLine("DONE");
Console.ReadLine();
}
private static void CreateConfig()
{
for (int i = 0; i < 1000; i++)
{
var config = new ConfigurationBuilder()
.SetBasePath(Environment.CurrentDirectory)
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.Build();
}
}
}
}
This roots tons of objects because of https://github.com/aspnet/Extensions/issues/786 they can’t be cleaned up.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
ConfigurationProviders leak memory · Issue #861
ConfigurationProviders leak memory #861 ... Dispose all disposable providers when disposing the ConfigurationRoot; In WebHost , dispose of ...
Read more >asp.net core - NETCORE ConfigurationRoot Memory Leak
We are facing memory leak issue with ConfigurationProviders ConfigurationRoot. However, Microsoft. Extensions. Configuration 3.0.
Read more >Configuration providers - .NET
Discover how to configure .NET apps using the configuration provider API and the available configuration providers.
Read more >Troubleshooting Memory Leak Issue on Rancher 2.7.2+
Users have reported instances of memory leaks in Rancher 2.7.2 - 2.7.4 deployments. This issue can lead to increased memory usage, potentially ...
Read more >Newer Java versions can cause native out of memory ...
The memory leak occurs when the IBMJCEPlus security provider is listed ahead of the IBMJCE security provider in the java.security configuration file.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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.
@davidfowl We still need the work on the AspNetCore side though. I’m working on that (currently struggling with getting the repo to build).