How to debug Azure Web App memory leaks?

爱⌒轻易说出口 提交于 2021-02-06 20:06:46

问题


There is the excellent Start Profiling button in the SCM portal that works perfect for CPU.

Then there are some sources that refer to a Download GC Dump button: https://stackoverflow.com/a/27987593/647845

But that doesn't seem to be available anymore.

Then there is the Download memory dump button. But for now I can't figure out how/if I can see the Type / Refcount / Size stastistics that I'm used too.

What is the recommended way to look for memory leaks in a C# Azure Web App?


回答1:


Try using Kudu console. Go to https://[sitename].scm.azurewebsites.net/support Click Analyze -> Dignostics -> Settings. Make sure Memory dumps is checked And then Click Dignose Now. This will work only in Basic plan and above (Not available for free plan) After some time you will get the dump Open the downloaded file with Visual studio and select "Debug managed memory". You can then see the details.




回答2:


Unfortunately the kudu support page has been deprecated. You can now find it under Diagnose and solve problems:

Once you've downloaded the dump files, open them in Visual Studio and click "Collect a memory dump" like the accepted answer from Grandhali suggested.




回答3:


You can download a memory dump using Kudu Console and use DebugDiag to profile it, you can have more than one memory dump, one before the leak happens, one during it and one after, later you can compare and see which objects are growing in size and not getting disposed




回答4:


Remote Profiling the Azure Web App from Visual Studio is probably the best option.

https://azure.microsoft.com/en-us/blog/remote-profiling-support-in-azure-app-service/



来源:https://stackoverflow.com/questions/36030776/how-to-debug-azure-web-app-memory-leaks

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