Symptom Details:

TestCaddy operates correctly most of the time but from time to time an action like simply selecting a test to view will take 20 seconds or more to complete.

If you were to analyse performance with SQL Profiler you would see Execution Errors like this:

<MemoryGrants xmlns='http://schemas.microsoft.com/sqlserver/2004/07/queryprocessor' Version='1.0' Build='10.50.1600.1'>
	<Grant>
		<SPID>54</SPID>
		<BatchId>0</BatchId>
		<SQLHandle>0x03000A000DD07C4F5991010152A000000100000000000000</SQLHandle>
		<PlanHandle>0x05000A000DD07C4F40214782000000000000000000000000</PlanHandle>
		<MemoryRequested>573</MemoryRequested>
		<MemoryGranted>0</MemoryGranted>
		<MemoryUsed>0</MemoryUsed>
		<DOP>0>/DOP>
		<TimeOutInMS>25000</TimeOutInMS>
		<MemoryRequestTime>2012-05-30 07:33:19.89</MemoryRequestTime>
		<MemoryGrantTime></MemoryGrantTime>
	</Grant>
</MemoryGrants>

This issue is logged in our system as ticket TC-770. To workaround the issue simply ensure that the SQL Server has a minimum Memory amount set, so that it can get memory grants quickly. We recommend a minimum of 500Mb. It is also a good idea to set the Maximum memory SQL can use so that there is plenty of memory for the Operating System as per this article: sql-server-optimal-memory-settings. Typically TestCaddy runs well with a minimum of 500Mb and a maximum of 2048Mb (assuming your machine has say 3Gb of RAM).