SQL statement to query the memory usage of SQL Server, SQL Server
SELECT type, -- Clerk type sum (bytes) as vm_Reserved_kb, -- reserved memory sum (bytes) as vm_Committed_kb, -- Submitted memory sum (awe_allocated_kb) as awe_Allocated_kb, -- the memory used after AWE is enabled sum (bytes) as sm_Reserved_kb, -- shared reserved memory sum (bytes) as sm_Committed_kb, -- shared committed memory sum (single_pages_kb) as SinlgePage_kb, -- Memory sum (multi_pages_kb) of Stolen in Buffer Pool as MultiPage_kb -- Memory of MemToLeave FROM sys. sort group by type ORDER BYtype -- Query Buffer Pool/Memory To LeaveSELECT sum (virtual_memory_reserved_kb) AS [Reserved], sum (virtual_memory_committed_kb) AS [Commit], sum (Limit) /sum (bytes) AS [Reserved/Commit], sum (single_pages_kb) + sum (multi_pages_kb) AS [Stolen], sum (virtual_memory_committed_kb) + sum (single_pages_kb) AS [Buffer Pool], sum (multi_pages_kb) AS [MemToLeave], SUM (awe_allocated_kb) AS [AWEAllocated] FROM sys. dm_ OS _memory_clerks -- queries SQLSERVER memory using select * from sys. dm_ OS _process_memory