none
Low Memory Error on Web App RRS feed

  • Question

  • Hello:

    I have a LightSwitch app that has been in production for a couple of years.  Yesterday, I started getting intermittent errors when the server is executing a function. The error that I am seeing is:

    "An error occurred while running the command.
    Error details: An error occurred while processing this request"

    I have looked at all the diagnostics and have not been able to pinpoint the error.  A couple of times, I got this error:

    "Memory gates checking failed because the free memory (80613376 bytes) is less than 5% of total memory. As a result, the service will not be available for incoming requests. To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element."

    The function that I am running, which generates a report on the server, will now occasionally work, but most of the time it fails.  Because of this, I think that this memory issue may be the root cause.

    Any ideas would be appreciated.

    Thanks,

    Mark

    Wednesday, February 17, 2016 4:29 PM

All replies

  • Are you using any kind of profiling service like App Insights or NewRelic?

    If not, I'd advice to install any of them, you'll be able to see the details in the errors and, more important, which Functions/Methods are running at those times to pinpoint which part of your code is having issues.

    They can even profile DB access and remote services calls.

    Wednesday, February 17, 2016 7:46 PM
  • Thanks for the response. I have set up Application Insights, but it does not report any errors that I can find.

    I had not changed anything in my app and I have no idea how to resolve this.  Can anyone at Microsoft help with this?  (I changed the name of my site in the error pasted below.  In order to find the site, please look for a web app in my subscription named "x00".  The site that I am getting the error on is three letters long.) 

    I did change the app pricing plan from S1 to S2 and it did not make any difference.  I have also restarted it several times. This is a production site and I really need to get this working.

    In Azure Diagnostics, I am getting this error:

    Title ASP.NET Unhandled exception detected
    Type Error
    Detected Condition /Events/Event[System[EventID=1309] and System/Provider/@Name="ASP.NET 4.0.30319.0" and EventData/Data[contains(.,"An unhandled exception")]]
    Solution Description An unhandled exception means there was a problem occurred and was not handled by your application.
     To get this issue resolved, please contact the vendor or developer. 
    Symptom An Unhandled exception from ASP.NET is detected. The following ASP.NET unhandled exception(s) are detected.
    Found 2 events

    -------------Event Found #1 -------------------

    <System>
     <Provider Name="ASP.NET 4.0.30319.0" />
     <EventID>1309</EventID>
     <Level>2</Level>
     <Task>0</Task>
     <Keywords>Keywords</Keywords>
     <TimeCreated SystemTime="2016-02-17T02:09:48Z" />
     <EventRecordID>315460906</EventRecordID>
     <Channel>Application</Channel>
     <Computer>RD00155DFC7146</Computer>
     <Security />
    </System>
    <EventData>
     <Data>3005</Data>
     <Data>An unhandled exception has occurred.</Data>
     <Data>2/17/2016 2:09:48 AM</Data>
     <Data>2/17/2016 2:09:48 AM</Data>
     <Data>5b149fa08ce64caab73d16fd8329c300</Data>
     <Data>83</Data>
     <Data>1</Data>
     <Data>0</Data>
     <Data>/LM/W3SVC/945705373/ROOT-2-131001478901168404</Data>
     <Data>Full</Data>
     <Data>/</Data>
     <Data>D:\home\site\wwwroot\</Data>
     <Data>RD00155DFC7146</Data>
     <Data></Data>
     <Data>3920</Data>
     <Data>w3wp.exe</Data>
     <Data>IIS APPPOOL\tpe</Data>
     <Data>InsufficientMemoryException</Data>
     <Data>Memory gates checking failed because the free memory (80613376 bytes) is less than 5% of total memory. As a result, the service will not be available for incoming requests. To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element.
     at System.ServiceModel.Activation.ServiceMemoryGates.Check(Int32 minFreeMemoryPercentage, Boolean throwOnLowMemory, UInt64& availableMemoryBytes)
     at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CheckMemoryCloseIdleServices(EventTraceActivity eventTraceActivity)
     at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)

    </Data>
     <Data>http://xxx-staging.azurewebsites.net/sqlazure_tpe1.svc/query_vw_MappingReportAccountsPL()?ClientId=82</Data>
     <Data>/sqlazure_xxx1.svc/query_vw_MappingReportAccountsPL()</Data>
     <Data>72.181.157.128</Data>
     <Data>mark_sutton@sbcglobal.net</Data>
     <Data>True</Data>
     <Data>Forms</Data>
     <Data>IIS APPPOOL\xxx</Data>
     <Data>14</Data>
     <Data>IIS APPPOOL\xxx</Data>
     <Data>False</Data>
     <Data> at System.ServiceModel.Activation.ServiceMemoryGates.Check(Int32 minFreeMemoryPercentage, Boolean throwOnLowMemory, UInt64& availableMemoryBytes)
     at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CheckMemoryCloseIdleServices(EventTraceActivity eventTraceActivity)
     at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
    </Data>
    </EventData>

    Thanks,

    Mark

    Tuesday, February 23, 2016 3:42 PM
  • By the exception text, it's a problem on a Report thats pointing to a SQL Azure DB.

    Could it be that the size of the Report increased and now your site, when it tries to process it and load it on memory, its running out of resources?

    Try getting a memory dump when the site goes down and you might see which objects are consuming most of your memory.

    Also, remember that, if you are running this on a Web App Slot, it's sharing the same resources of the production Web App Slot and the same resources as all the apps in your App Service.

    Tuesday, February 23, 2016 7:56 PM