Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Applies to:
SQL Server 2025 (17.x) and later versions
The max lock manager cache memory (%) server configuration option limits the amount of memory that the lock manager cache can use, as a percentage of the total SQLOS committed memory. By default, the configuration is set to 20 percent.
Availability
This configuration option is available in the following SQL platforms and versions:
- SQL Server 2025 (17.x) Cumulative Update (CU) 5 and later versions
Remarks
When a lock is released, the memory used by the lock structure isn't freed, but is cached by the lock manager to avoid the memory allocation overhead in subsequent lock acquisition and to improve performance.
Before SQL Server 2025 (17.x) CU 5 and in previous versions of SQL Server, the lock manager cache can grow up to the maximum size of lock manager memory, which is 60 percent of the total SQLOS committed memory. A workload can grow the size of the lock manager cache up to this limit. For example, this uncommon situation can occur in large concurrent query workloads when lock escalation is disabled for the Database Engine instance. If the lock manager cache grows large, the buffer pool, plan cache, and other memory caches for a SQL Server instance shrink, reducing performance.
In SQL Server 2025 (17.x) CU 5 and later versions, the maximum size of the lock manager cache is limited to 20 percent by default. Lock manager memory can still grow up to 60 percent of the SQLOS committed memory if required by the workload. However, when locks are released, memory is freed rather than cached if the lock manager cache already reached its configured limit.
Setting the max lock manager cache memory (%) configuration to a value larger than 20 percent isn't recommended, but is supported for backward compatibility. You can set the value in the 20-60 percent range.
You can monitor the total size of lock manager memory using sys.dm_os_memory_clerks, with OBJECTSTORE_LOCK_MANAGER as the memory clerk type. On an idle database engine instance, the reported value is the size of lock manager cache memory.
Examples
A. Set the maximum size of the lock manager cache memory
The following example sets the max lock manager cache memory to 25 percent:
EXECUTE sp_configure 'show advanced options', 1;
RECONFIGURE;
EXECUTE sp_configure 'max lock manager cache memory (%)', 25;
RECONFIGURE;
B. Monitor lock manager memory
The following example shows the current size of the lock manager memory. The value includes the memory held by the acquired locks, if any, and the memory cached to improve performance of subsequent lock acquisition.
SELECT SUM(pages_kb) / 1024. AS lock_manager_cache_memory_mb
FROM sys.dm_os_memory_clerks
WHERE type = 'OBJECTSTORE_LOCK_MANAGER';