How to get visibility / debugging of large memory usage in dotnet Core application running in IIS

We have an application that we recently ported to use the Aspnet template.and have a number of memory problems. Our initial symptom was heavy use of memory without decline during use. Memory usage increased during the night and on weekends, but not at the speed that it did at peak times. When I print this, I track and see that the application uses 5 GB of memory in the system, when normal use will be no more than 500 - 550 MB. We profiled the application using a couple of memory profiling tools, and found a couple of potential leaks in the framework libraries and in the Kestrel version that we referred to, but even after fixing the problems, the trace remained heavy. The behavior that we see now - the use of application memory, will grow indefinitely,but forced garbage collection in memory profiling tools will recover large volumes. Monitoring the application over the weekend showed that the application works fine under low usage, but today (Monday) at peak times the application is bleeding again. I am not sure which direction to go, or how to get information about what the real problem is. Memory profiling tools show no obvious leaks or problems in this regard, and the fact that the memory can be fixed by forcing garbage collection seems suspicious to me.or how to get information about what the real problem is. Memory profiling tools show no obvious leaks or problems in this regard, and the fact that the memory can be fixed by forcing garbage collection seems suspicious to me.or how to get information about what the real problem is. Memory profiling tools show no obvious leaks or problems in this regard, and the fact that the memory can be fixed by forcing garbage collection seems suspicious to me.

+4
source share
2 answers

Unfortunately, it seems that the actual problem was buried within the framework that we used, in particular, the problem with the dependency injection library, which does not correctly handle time dependencies. We worked with a third-party library provider, and they included the fix in a newer build, which fixed our problem 100%.

+1
source

Kestrel handles garbage collection (GC), which is slightly different from ASPNET on IIS. Kestrel has the ability to be much faster than ASPNET, and one way to achieve this success is to reduce GC pressure. Here is a more detailed article:

https://www.poppastring.com/blog/ASPNETCoreKestrelTheNeedForSpeed.aspx

, , Kestrel GC . - , , GC.

+1

Source: https://habr.com/ru/post/1672733/


All Articles