4

I ran into a situation where out of memory exceptions were generated in our Azure App Service for a .Net Core Web API even though memory & utilization topped 50% in the App Service Plan (P2V2: 7GB RAM).

I have looked at this SO article to check private bytes and other things but still don't see where the memory of exhaustion comes from. I see a max usage of 1.5GB on the memory working set which is well below the 7GB.

Nothing shows up under Support + Troubleshooting -> Resource Health or App Service Advisor.

I am not sure where to look next and any help would be appreciated.

Pascal
  • 148
  • 11

2 Answers2

4

Azure App Services caps memory usage at 1.5G by default. But you can change this behaviour with this application setting (to be added under Configuration):

WEBSITE_MEMORY_LIMIT_MB = 3072

See also my answer here: Is there way to determine why Azure App Service restarted?

0

The Metrics view on the portal can only go up to a 1 minute granularity level. (The default is 5 minutes)

This means that each metric point is an average value over a 60-second interval. It may be spiking up and down over 60 seconds, so you need a more real-time view.

Try the SCM console (Advanced Tools > Go), and check the Process Explorer to see the actual memory consumption.

Jasonh
  • 11
  • Thanks Jasonh for answering. This is the same view as Process Explorer under Monitoring. It gives me the current memory utilized. I can certainly go there to get a granular info on a per process but it does not explain how I can get a memory exhaustion when the process reached 1.5GB which is well below the allocated 7GB. – Pascal May 03 '19 at 01:32