The Memory Manager object in Microsoft® SQL Server™ provides counters to monitor overall server memory usage. Monitoring overall server memory usage to gauge user activity and resource usage can help you to identify performance bottlenecks. Monitoring the memory used by SQL Server can help determine, for example, if bottlenecks exist due to a lack of available physical memory for storing frequently accessed data in cache, in which case SQL Server must retrieve the data from disk. By monitoring memory, you can determine if query performance can be improved by adding more memory or by making more memory available to the data cache or SQL Server internal structures.
These are the SQL Server Memory Manager counters.
SQL Server Memory Manager counters | Description |
---|---|
Connection Memory (KB) | Total amount of dynamic memory the server is using for maintaining connections. |
Granted Workspace Memory (KB) | Total amount of memory currently granted to executing processes such as hash, sort, bulk copy, and index creation operations. |
Lock Blocks | Current number of lock blocks in use on the server (refreshed periodically). A lock block represents an individual locked resource, such as a table, page, or row. |
Lock Blocks Allocated | Current number of allocated lock blocks. At server startup, the number of allocated lock blocks plus the number of allocated lock owner blocks depends on the SQL Server Locks configuration option. If more lock blocks are needed, the value increases. |
Lock Memory (KB) | Total amount of dynamic memory the server is using for locks. |
Lock Owner Blocks | Number of lock owner blocks currently in use on the server (refreshed periodically). A lock owner block represents the ownership of a lock on an object by an individual thread. Therefore, if three threads each have a shared (S) lock on a page, there will be three lock owner blocks. |
Lock Owner Blocks Allocated | Current number of allocated lock owner blocks. At server startup, the number of allocated lock owner blocks plus the number of allocated lock blocks depends on the SQL Server Locks configuration option. If more lock owner blocks are needed, the value increases dynamically. |
Maximum Workspace Memory (KB) | Maximum amount of memory available for executing processes such as hash, sort, bulk copy, and index creation operations. |
Memory Grants Outstanding | Total number of processes per second that have successfully acquired a workspace memory grant. |
Memory Grants Pending | Total number of processes per second waiting for a workspace memory grant. |
Optimizer Memory (KB) | Total amount of dynamic memory the server is using for query optimization. |
SQL Cache Memory (KB) | Total amount of dynamic memory the server is using for the dynamic SQL cache. |
Target Server Memory (KB) | Total amount of dynamic memory the server is willing to consume. |
Total Server Memory (KB) | Total amount of dynamic memory (in kilobytes) that the server is currently using. |
Understanding Locking in SQL Server