Memory leak - why too many “Ichangetoken” objects

好久不见. 提交于 2019-12-24 22:23:53

问题


Above is the screenshot when compared to baseline of memory dump. I have an api method, which I'm calling every 3 seconds and nothing else is going on in the environment like, no user using the environment.

When I debug in VS2017, for each request that I make, I it is calling some services like "addtransient","addscopped" etc. and in the startup file we are configuring different config files

 return builder.AddDataEngineFile(s =>
             {
            s.FileProvider = provider;
            s.Path = path;
            s.Optional = optional;
            s.ReloadOnChange = false; <-- no reload
            s.ResolveFileProvider();

             });

My understanding physicalfilechange watcher triggers changetoken only when reloadonchange is set to true. but it looks like that is not the case, still not sure what is causing this object count to go up, and when I do GC.collect it doesn't decrease the count of the objects.

why Microsoft.extensions.configuration.configurationsection or Ichangetoken has too many objects?


回答1:


NLog.Extensions.Logging ver. 1.5.3 has been released:

https://www.nuget.org/packages/NLog.Extensions.Logging/

This should resolve the issue with leak. Curious why MEL-config-filewatcher is constantly triggering autoreload in your application.



来源:https://stackoverflow.com/questions/57485634/memory-leak-why-too-many-ichangetoken-objects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!