There is insufficient memory available in the buffer pool

Recently one of the developers sent me following error:
Message: SQL Error [Microsoft OLE DB Provider for SQL Server: There is insufficient memory available in the buffer pool.
SQL State: 42000    Native Error: 802
State: 20     Severity: 17
SQL Server Message: There is insufficient memory available in the buffer pool.
I checked the memory usage by components under Memory Consumption server report. Following is the screenshot of the report:

I found that CACHESTORE_SQLCP was allocated most memory. This type of memory clerk indicates memory consumption by plans of SQL statements or batches not found in any stored procedures, triggers or functions. I just wanted to clear pool for CACHESTORE_SQLCP. The name for this memory clerk is "SQL Plans". Which I found by querying sys.dm_os_memory_clerks dynamic management view. I then executed the following command to clear the pool for CACHESTORE_SQLCP.

DBCC FREESYSTEMCACHE('SQL Plans')

The memory allocated to that clerk was reduced now as per the below screenshot:

This resolved the issue. User was then able to execute the same query with no issue.

Make Money from Surveys

Popular posts from this blog

The current master key cannot be decrypted

Schema.Object has an unresolved reference to Schema

Remove dateModified related warning appearing during Structured data testing