FIX: CMEMTHREAD waits occur when you execute many ad hoc queries in SQL Server 2012 or SQL Server 2014

Symptoms

Assume that you have many statistics and tables and the tables contain many columns in a Microsoft SQL Server 2012 or SQL Server 2014 database. When you execute many ad hoc queries to retrieve data from those tables concurrently, you may experience CMEMTHREAD waits during the execution.

Resolution

Cumulative Update information

The issue was first fixed in the following cumulative update of SQL Server.
Recommendation: Install the latest cumulative update for SQL Server

More Information

When you compile or recompile a query in SQL Server 2012, the engine needs to get inputs from statistics histogram. We need to perform a system table scan and then load the specific histogram of the tables that are involved into memory or cache. These system table entries (for the statistics) are stored in the System Table cache (CACHESTORE_SYSTEMROWSET). The memory object that is used to create these entries in the cache is not partitioned, and is global.

Therefore, if you have concurrent memory allocations performed during this operation, you will encounter CMEMTHREAD waits on this memory object. This usually happens when you submit lots of queries that require compilation or recompilation.

This hotfix changes the global memory object to be partitioned so that concurrent memory allocations that use the System Table cache will not encounter contention and the CMEMTHREAD waits.

For more information about the similar issue, see KB 3026082: FIX: SOS_CACHESTORE spinlock contention on system table rowset cache causes high CPU usage in SQL Server 2012 or 2014 .

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
內容

文章識別碼:3074425 - 最後檢閱時間:2015年8月17日 - 修訂: 1

意見反應