Search code examples
azurememory-leaksazure-web-app-servicedebugdiagprocdump

how to analyze memory leaks for "azure web apps" (PaaS)


I am looking to analyze memory leaks for the web app deployed in azure.

Referring to following urls

we were able to extract memory dump and analyze them. but since we were not able to inject the LeakTrack dll / enable memory leaks tracking when collecting the dump, we are getting message that leak analysis was not performed due to not injecting the dll on performing memory analysis.

please suggest how to find out memory leakages from analyzing the dump in this scenario.


Solution

  • As you said, DebugDiag currently can't create reflected process dumps, and ProcDump doesn't have a way to inject the LeakTrack dll to track allocations. So, we could get around by working with both tools.

    We can simply go to the Processes tab in DebugDiag, right click the process, and chose "Start Monitory for Leaks." We can do that by scripting DebugDiag and ProcDump to do the individual tasks we've set out for them.

    Once we have the PID of the troubled process, we can use a script to inject the LeakTrack dll into the process. With the PID known and the script created, we can launch DebugDiag from a command line. Such as:

     C:\PROGRA~1\DEBUGD~1\DbgHost.exe -script "your LeakTrack dll path" -attach your PID
    

    For more detail, you could refer to this article.

    Here is also the reference case.