0

I am using Azure Blob storage. Everything work fine, but sometime i get following error intermittently:

"$type": "System.Web.Http.HttpError, System.Web.Http",
"Message": "An error has occurred.",
"ExceptionMessage": "Exception of type 'System.OutOfMemoryException' was thrown.",
"ExceptionType": "System.OutOfMemoryException",
"StackTrace": "   at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.get_Result()
   at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.ExecuteAndWait()
   at Microsoft.WindowsAzure.StorageClient.TaskImplHelper.ExecuteImplWithRetry(Func`1 impl, RetryPolicy policy)
   at Microsoft.WindowsAzure.StorageClient.CloudBlobContainer.SetPermissions(BlobContainerPermissions permissions, BlobRequestOptions options)

It's really hard to recreate the issue on my local. Any solutions ?

astaykov
  • 30,768
  • 3
  • 70
  • 86
Sabby62
  • 1,707
  • 3
  • 24
  • 37
  • yep. Scale the Azure Web Apps tier. I assume you use Free or Shared, which both have memory limits - 1024 MB per hour. Which is calculated as Peak memory use. If your app reaches 1024MB memory usage, your site will be suspended and you will also get an Out-of-memory exception. – astaykov Jul 14 '15 at 18:33
  • I am using Standard app tier with 7 GB memory. – Sabby62 Jul 14 '15 at 18:38
  • Is it I am getting exception when I am setting permission for blob container ? – Sabby62 Jul 14 '15 at 18:50
  • 2
    Have you looked at how much data is stored in your storage account? Overall the storage account can hold 500TB of data, however, there are other [quotas](https://azure.microsoft.com/en-us/documentation/articles/azure-subscription-service-limits/#storage-limits) and [performance targets](https://azure.microsoft.com/en-us/documentation/articles/storage-scalability-targets) to be aware of – cory-fowler Jul 15 '15 at 03:12
  • Can you provide the code that you are using to call SetPermissions? – Tamra Myers - Microsoft Jul 17 '15 at 01:36

2 Answers2

1

The following Stack Overflow thread might help C# : Out of Memory exception. To summarize, if you haven't already, try changing your platform target to x64 and see if that helps.

Community
  • 1
  • 1
Michael Curd
  • 617
  • 4
  • 10
0

There was memory leak in the application with Windsor IOC not releasing object for GC. That was the root problem for this error.

Sabby62
  • 1,707
  • 3
  • 24
  • 37
  • With respect, Windsor will release everything you tell it to. Failing to follow very simple guidance for the use of Castle Windsor ("Release everything you Resolve") is a common cause of memory leaks. – Phil Degenhardt Aug 03 '15 at 02:57