Bruce Hunter - 450 - Apr 23, 2014

.NET is known to have issues with GC running at bad times. When you least expect it. The release of 4.5 framework has helped reduce pauses with request/response.

How do you suggest utilizing the new feature for GC “SustainedLowLatency” with ServiceStack?

Are there any recommendations for using this within ASP.NET?

SustainedLowLatency sounds like its for avoiding Gen2 GC collection if possible and is only available on .NET 4.5 on server GC’s (answer #1):
http://social.msdn.microsoft.com/Forums/vstudio/en-US/9e9c7aa0-8ff9-401f-8ae3-e866e8d53572/sustainedlowlatency-question

Which will cause issues if run on .NET 4.0 (SS is .NET 4.0):
http://stackoverflow.com/questions/15593183/gclatencymode-sustainedlowlatency-under-clr-4-0#comment22110370_15593183

Otherwise a good time to force a GC.Collect() may be on AppHost.EndRequest() after the response is written. Though you wouldn’t want to do this with every request so may need to to something like
if (noOfRequests++ % 1000 == 0) GC.Collect();

Bruce Hunter:

Hmm, yeah I forgot that SS is using .NET 4.0.30319