内存泄漏-为什么过多的"Ichangetoken"对象 [英] Memory leak - why too many "Ichangetoken" objects

查看:178
本文介绍了内存泄漏-为什么过多的"Ichangetoken"对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上图是与内存转储的基线进行比较时的屏幕截图. 我有一个api方法,每3秒调用一次,在环境中没有其他事情发生,例如没有用户在使用该环境.

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.

当我在VS2017中调试时,对于我发出的每个请求,它都在调用诸如"addtransient","addscopped"等之类的服务,并且在启动文件中我们配置了不同的配置文件

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();

             });

仅当reloadonchange设置为true时,我对Physicalfilechange观察器的了解才触发changetoken.但是看起来情况并非如此,仍然不确定是什么导致该对象计数上升,而且当我执行GC.collect时,它并不会减少对象计数.

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.

为什么Microsoft.extensions.configuration.configuration节或Ichangetoken的对象太多?

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

推荐答案

NLog.Extensions.Logging版本. 1.5.3已发布:

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

https://www.nuget.org/packages/NLog.Extensions.记录/

这应该可以解决泄漏问题.奇怪为什么MEL-config-filewatcher不断触发应用程序中的自动重装.

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

这篇关于内存泄漏-为什么过多的"Ichangetoken"对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆