question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ConfigurationProviders leak memory

See original GitHub issue
using 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.

image

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
davidfowlcommented, Jan 11, 2019

@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.

0reactions
pokecommented, Jan 11, 2019

@davidfowl We still need the work on the AspNetCore side though. I’m working on that (currently struggling with getting the repo to build).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found