LATCH_EX

HIGH Memory
#latch#memory#contention
Related diagnostic scripts:

Overview

Occurs when waiting for an exclusive latch on an in-memory structure. Unlike PAGEIOLATCH, this is pure memory contention — no disk I/O involved. Typically indicates NUMA node contention or THREADPOOL-like pressure.

Key Metrics

MetricDescription
Wait TypeLATCH_EX
CategoryMemory
SeverityHIGH

Troubleshooting

1. Identify the source

Use the following query to identify the top queries contributing to LATCH_EX waits:

SELECT TOP 10
 [Wait Type] = wait_type,
 [Wait Seconds] = wait_time_ms / 1000,
 [Wait Count] = waiting_tasks_count,
 [Avg Wait Ms] = wait_time_ms / NULLIF(waiting_tasks_count, 0)
FROM sys.dm_os_wait_stats
WHERE wait_type = 'LATCH_EX'
ORDER BY wait_time_ms DESC;

See Also