Insufficient Memory of the SQL Server When the Number of NEs Exceeds 5000
Question
When the number of NEs exceeds 5000, the memory of the SQL server is insufficient. The SQL server database logs record a large number of errors, including 701 (insufficient memory), 1101 (insufficient database space), 1105 (the original file group of the database is full and no space can be allocated to the object name).
Answer
Most of the SQL server cache plans are adhoc cache plans. You can delete some unnecessary cache plans to release the cache. The procedure is as follows:
- Connect to the Microsoft SQL Server 2012 R2 and check the database attributes. For details, see Configuring the Maximum Server Memory for Microsoft SQL Server 2012 R2.
- In the Server Properties dialog box, choose Advanced and set Optimize for Ad hoc Workloads to True.