How to debug Azure Web App memory leaks?

Dirk Boer picture Dirk Boer · Mar 16, 2016 · Viewed 7.5k times · Source

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

enter image description here

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?

Answer

Gandhali Samant picture Gandhali Samant · Mar 18, 2016

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 enter image description here Open the downloaded file with Visual studio and select "Debug managed memory". You can then see the details. enter image description here