Rob Reagan
Rob Reagan

Reputation: 7696

How to diagnose a memory leak in an Azure WebJob

I suspect that I may have a memory leak in a WebJob, but I'm not certain how to definitively prove that I do. I suspect that I can find the information by going to the /processExplorer in the Kudu management console, start a profile, and download the results. However, I am not entirely sure if this is the route to go or what I should do with the file once I get it.

Any suggestions would be appreciated.

Upvotes: 2

Views: 2130

Answers (1)

Amor
Amor

Reputation: 8509

I can find the information by going to the /processExplorer in the Kudu management console, start a profile, and download the results

After you get the .diagsession file, you could open it with Visual Studio. You will see the CPU usage trend, but memory data is not include in this file. To easily identify whether there is a memory leak, Steps below are for your reference.

  1. Refresh the Process Explorer on kudu manually and timely(For example once per 30s).
  2. After you refresh the Process Explorer, you need to record the private memory and virtual memory which will be used for diagnose memory leak. By click the Properties button after the Process name, you will see the private memory and virtual memory of current Process.
  3. After you have finished recording enough data, you need to compare the grow speed of virtual memory and private memory. If both virtual memory and private memory grow fast or virtual memory grows faster than private memory, it means there is a memory leak.

If you need more information of memory leak, you could download the memory dump file from Process Properties page and view the detail information of it using WinDbg. You also could analyze the dump file online using Diagnostics as a Service for Azure Web Sites. For more information about how to use it. Link below is for your reference.

DaaS – Diagnostics as a Service for Azure Web Sites

Upvotes: 2

Related Questions