Azure App Service encountered OutOfMemory Exceptions but didn't show memory increase in dashboard

Angel Lan (debug) 0 Reputation points
2025-01-09T00:33:43.5966667+00:00

User's image

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,211 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bhargavi Naragani 0 Reputation points Microsoft Vendor
    2025-01-23T12:06:58+00:00

    Hi @Angel Lan (debug),
    Thanks for the question and using MS Q&A platform.
    It seems like you're encountering the OutOfMemory (OOM) issue within your Azure App Service, the memory usage charts show no significant spikes or increases, and the app's memory usage appears low.

    1. Rarely, platform-level restrictions or temporary conditions can cause memory constraints.
    2. Ensure that your app service plan's memory allocation is not being shared with other apps or services that might be consuming memory.
    3. Sometimes, memory is distributed among multiple apps on the same plan, which can cause unexpected OOM exceptions.
    4. Since you've already analyzed the heap snapshot using Visual Studio, consider using more advanced tools like Azure Memory Dump Analysis tool or dotmemory to get a deeper insight into memory usage patterns and identify any hidden issues.
    5. Turn on Application Insights with memory profiling enabled. This will give you a more granular view of memory allocation and help pinpoint any anomalies. Also, enable crash dumps in the app’s diagnostic settings to capture more data during an OOM event.
    6. Sometimes, OOM issues are caused by excessive or poorly managed connections (e.g., database connections, HTTP requests). Double-check your connection pooling, timeouts, and retry logic in your code.
    7. If the issue persists, consider scaling up to a higher-tier App Service Plan or enabling autoscaling to distribute the workload across multiple instances. Optimize memory usage by reviewing caching mechanisms, static data, and third-party libraries.
      OOM overview:
      https://learn.microsoft.com/en-us/azure/azure-monitor/app/app-insights-overview
      Diagnostics and solve tool - Azure App Service | Microsoft Learn

    Hope the above provided information help in better understanding and help you resolve the issue, if you have any further concerns or queries, please feel free to reach out to us.
    If the answer is helpful, please click Accept Answer and kindly upvote it so that other people who faces similar issue may get benefitted from it.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.