CMEMPARTITIONED Wait Type in SQL Server

CMEMPARTITIONED is a wait for access to a thread-safe partitioned memory object. It is the sibling of CMEMTHREAD: when a shared memory object becomes a contention point, SQL Server can partition it by node or by CPU so threads mostly touch their local partition. CMEMTHREAD is contention on an unpartitioned object; CMEMPARTITIONED is the (much rarer) contention that still happens on a partitioned one.

In other words, this wait is the residue left after the standard cure for memory object contention has already been applied.

Is It a Problem?

Rarely, and its normal profile is tiny waits in large counts. Partitioning spreads allocations across CPUs, so meaningful time here means either extraordinary allocation rates hammering even per-CPU partitions, or a workload concentrated on few schedulers defeating the point of partitioning.

If it ever features in your top waits, treat it like CMEMTHREAD: the question is which memory object, and what is allocating from it so hot.

Common Causes

  • Extremely high-frequency allocations against one memory object (plan cache churn, security or metadata caches) even after partitioning.
  • Workloads pinned to few CPUs, concentrating what partitioning was meant to spread.
  • Very high core counts amplifying any remaining cross-partition synchronisation.

What To Do

  1. Confirm it is really this wait and not CMEMTHREAD; the unpartitioned sibling is the common one and has known trace-flag mitigations (like TF 8048 historically, now default behaviour).
  2. Reduce the allocation churn at the source: parameterise ad hoc queries to calm plan cache turnover, and look for hot code paths compiling or allocating per call.
  3. Check sys.dm_os_memory_objects for the partitioned objects with the most activity if you need the specific structure.

How To See It

Rank it against everything else with Get-WaitStatistics. Read it with CMEMTHREAD; together they describe memory object contention before and after partitioning.


Part of the SQL Server Wait Types Library.
Related deep dive: RESOURCE_SEMAPHORE Wait Type.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *