Skip to content

Instantly share code, notes, and snippets.

@awithy
Created January 27, 2012 11:16
Show Gist options
  • Save awithy/1688334 to your computer and use it in GitHub Desktop.
Save awithy/1688334 to your computer and use it in GitHub Desktop.
WorkingSetMemoryIssues
var workingSet = Environment.WorkingSet;
if (workingSet >= RecycleThresholdBytes)
{
Logger.TraceWarning("Maximum working set exceeded (" + workingSet + "). Role shall now be recycled.");
RoleEnvironment.RequestRecycle();
}
else if(workingSet >= WarningThresholdBytes)
{
ErrorSink.Error("The worker role process has an elevated working set (" + workingSet + ").");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment