问题
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