Article ID: 907877 - Last Review: November 20, 2007 - Revision: 1.3 How to use the DBCC MEMORYSTATUS command to monitor memory usage on SQL Server 2005On This PageSUMMARYThis article discusses the output of the DBCC MEMORYSTATUS command. This command is frequently used to troubleshoot Microsoft SQL Server memory consumption issues. This article describes the elements of the output for Memory Manager, for the summary of memory usage, for the aggregate memory information, for the buffer distribution information, for the buffer pool information, and for the procedure cache information. It also describes the output about global memory objects, about query memory objects, about optimization, and about memory brokers. INTRODUCTIONThe DBCC MEMORYSTATUS command provides a snapshot of the current memory status of Microsoft SQL Server. You can use the output from this command to troubleshoot memory consumption issues in SQL Server or to troubleshoot specific out-of-memory errors. (Many out-of-memory errors automatically print this output in the error log.) Microsoft Customer Support Services may also request that you run this command during a specific support incident if you are experiencing an error that may be associated with a low-memory condition. Note Performance Monitor (PerfMon) and Task Manager do not account for memory correctly if Address Windowing Extentions (AWE) support is enabled. This article describes some of the data that you can obtain from the output of the DBCC MEMORYSTATUS command. Several sections of this article include proprietary implementation details that are not explained here. Microsoft Customer Support Services will not answer any questions or provide more information about the meaning of specific counters beyond the information that is supplied in this article. MORE INFORMATIONImportant The DBCC MEMORYSTATUS command is intended to be a diagnostic tool for Microsoft Customer Support Services. The format of the output and the level of detail that is provided are subject to change between service packs and product releases. The functionality that the DBCC MEMORYSTATUS command provides may be replaced by a different mechanism in later product versions. Therefore, in later product versions, this command may no longer function. No additional warnings will be made before this command is changed or removed. Therefore, applications that use this command may break without warning. The output of the DBCC MEMORYSTATUS command has changed from earlier releases of SQL Server. The output now contains several sections that were unavailable in earlier product versions. Memory ManagerThe first section of the output is Memory Manager. This section shows overall memory consumption by SQL Server.Memory Manager KB ------------------------------ -------------------- VM Reserved 1761400 VM Committed 1663556 AWE Allocated 0 Reserved Memory 1024 Reserved Memory In Use 0 (5 row(s) affected)
Summary of memory usageThe Memory Manager section is followed by a summary of memory usage for each memory node. In a Non-uniform memory access (NUMA) enabled system, there will be a corresponding Memory node entry for each hardware NUMA node. In an SMP system, there will be a single Memory node entry.Note The memory node ID may not correspond to the hardware node ID. Memory node Id = 0 KB ------------------------------ -------------------- VM Reserved 1757304 VM Committed 1659612 AWE Allocated 0 MultiPage Allocator 10760 SinglePage Allocator 73832 (5 row(s) affected) The elements in this section are the following:
Aggregate memoryThe next section contains aggregate memory information for each clerk type and for each NUMA node. For a NUMA-enabled system, you may see output that is similar to the following.Note The following table contains only part of the output. MEMORYCLERK_SQLGENERAL (node 0) KB ---------------------------------------------------------------- -------------------- VM Reserved 0 VM Committed 0 AWE Allocated 0 SM Reserved 0 SM Commited 0 SinglePage Allocator 592 MultiPage Allocator 2160 (7 row(s) affected) MEMORYCLERK_SQLGENERAL (node 1) KB ---------------------------------------------------------------- -------------------- VM Reserved 0 VM Committed 0 AWE Allocated 0 SM Reserved 0 SM Commited 0 SinglePage Allocator 136 MultiPage Allocator 0 (7 row(s) affected) MEMORYCLERK_SQLGENERAL (Total) KB ---------------------------------------------------------------- -------------------- VM Reserved 0 VM Committed 0 AWE Allocated 0 SM Reserved 0 SM Commited 0 SinglePage Allocator 728 MultiPage Allocator 2160 (7 row(s) affected) For an SMP system, you will see only one section for each clerk type. This section is similar to the following. MEMORYCLERK_SQLGENERAL (Total) KB ---------------------------------------------------------------- -------------------- VM Reserved 0 VM Committed 0 AWE Allocated 0 SM Reserved 0 SM Commited 0 SinglePage Allocator 768 MultiPage Allocator 2160 (7 row(s) affected)
Buffer distributionThe next section shows the distribution of 8-kilobyte (KB) buffers in the buffer pool.Buffer Distribution Buffers ------------------------------ ----------- Stolen 553 Free 103 Cached 161 Database (clean) 1353 Database (dirty) 38 I/O 0 Latched 0 (7 row(s) affected)
Buffer pool detailsYou can obtain detailed information about buffer pool buffers for database pages by using the sys.dm_os_buffer_descriptors DMV. And you can obtain detailed information about buffer pool pages that are being used for miscellaneous server purposes by using the sys.dm_os_memory_clerks DMV.The next section lists details about the buffer pool plus additional information. Buffer Counts Buffers ------------------------------ -------------------- Committed 1064 Target 17551 Hashed 345 Stolen Potential 121857 External Reservation 645 Min Free 64 Visible 17551 Available Paging File 451997 (8 row(s) affected)
Procedure cacheThe next section describes the makeup of the procedure cache.Procedure Cache Value ------------------------------ ----------- TotalProcs 4 TotalPages 25 InUsePages 0 (3 row(s) affected)
Global memory objectsThe next section contains information about various global memory objects. This section also contains information about how much memory the global memory objects use.Global Memory Objects Buffers ------------------------------ -------------------- Resource 126 Locks 85 XDES 10 SETLS 2 SE Dataset Allocators 4 SubpDesc Allocators 2 SE SchemaManager 44 SQLCache 41 Replication 2 ServerGlobal 25 XP Global 2 SortTables 2 (12 row(s) affected)
Query memory objectsThe next section describes Query Memory grant information. This section includes a snapshot of the query memory usage. Query memory is also known as workspace memory.Query Memory Objects Value ------------------------------ ----------- Grants 0 Waiting 0 Available (Buffers) 14820 Maximum (Buffers) 14820 Limit 10880 Next Request 0 Waiting For 0 Cost 0 Timeout 0 Wait Time 0 Last Target 11520 (11 row(s) affected) Small Query Memory Objects Value ------------------------------ ----------- Grants 0 Waiting 0 Available (Buffers) 640 Maximum (Buffers) 640 Limit 640 (5 row(s) affected) The elements in this section are the following:
OptimizationThe next section is a summary of the users who are trying to optimize queries at the same time.Optimization Queue Value ------------------------------ -------------------- Overall Memory 156672000 Last Notification 1 Timeout 6 Early Termination Factor 5 (4 row(s) affected) Small Gateway Value ------------------------------ -------------------- Configured Units 8 Available Units 8 Acquires 0 Waiters 0 Threshold Factor 250000 Threshold 250000 (6 row(s) affected) Medium Gateway Value ------------------------------ -------------------- Configured Units 2 Available Units 2 Acquires 0 Waiters 0 Threshold Factor 12 (5 row(s) affected) Big Gateway Value ------------------------------ -------------------- Configured Units 1 Available Units 1 Acquires 0 Waiters 0 Threshold Factor 8 (5 row(s) affected) Note This amount does not include the memory that is required to run the query. When a query starts, there is no limit on how many queries can be compiled. As the memory consumption increases and reaches a threshold, the query must pass a gateway to continue. There is a progressively decreasing limit of simultaneously compiled queries after each gateway. The size of each gateway depends on the platform and the load. Gateway sizes are chosen to maximize scalability and throughput. If the query cannot pass a gateway, the query will wait until memory is available. Or, the query will return a time-out error (Error 8628). Additionally, the query may not acquire a gateway if the user cancels the query or if a deadlock is detected. If a query passes several gateways, the query does not release the smaller gateways until the compilation process has completed. This behavior lets only a few memory-intensive compilations occur at the same time. Additionally, this behavior maximizes throughput for smaller queries. Memory brokersThe next three sections show information about memory brokers that control cached memory, stolen memory, and reserved memory. Information that these sections provide can only be used for internal diagnostics. Therefore, this information is not detailed here.MEMORYBROKER_FOR_CACHE Value -------------------------------- -------------------- Allocations 1843 Rate 0 Target Allocations 1843 Future Allocations 0 Last Notification 1 (4 row(s) affected) MEMORYBROKER_FOR_STEAL Value -------------------------------- -------------------- Allocations 380 Rate 0 Target Allocations 1195 Future Allocations 0 Last Notification 1 (4 row(s) affected) MEMORYBROKER_FOR_RESERVE Value -------------------------------- -------------------- Allocations 0 Rate 0 Target Allocations 1195 Future Allocations 0 Last Notification 1 (4 row(s) affected) APPLIES TO
| Article Translations
|

Back to the top
