SQL statement query SQL server memory usage

Time:2021-4-6
Select type, - type of clerk  
sum(virtual_ memory_ reserved_ kb)as vm_ Reserved_ KB, - reserved memory  
sum(virtual_ memory_ committed_ kb)as vm_ Committed_ KB, - committed memory  
sum(awe_ allocated_ kb)as awe_ Allocated_ KB, - memory used after awe is turned on  
sum(shared_ memory_ reserved_ kb)as sm_ Reserved_ KB, - shared reserved memory  
sum(shared_ memory_ committed_ kb)as sm_ Committed_ KB, - shared committed memory  
sum(single_ pages_ kb)as SinlgePage_ Memory of stolen in KB, - buffer pool  
sum(multi_ pages_ kb)as MultiPage_ KB -- memory of memtoleave
FROM sys.dm_os_memory_clerks 
GROUP BY type ORDER BYtype
 
--Query buffer pool / memory to leave
SELECT
 sum(virtual_memory_reserved_kb)AS [Reserved],
 sum(virtual_memory_committed_kb)AS [Commit],
 sum(virtual_memory_reserved_kb)/sum(virtual_memory_committed_kb) 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
 
--Query SQL server memory usage

select * from sys.dm_os_process_memory

Recommended Today

Analysis of super comprehensive MySQL statement locking (Part 1)

A series of articles: Analysis of super comprehensive MySQL statement locking (Part 1) Analysis of super comprehensive MySQL statement locking (Part 2) Analysis of super comprehensive MySQL statement locking (Part 2) Preparation in advance Build a system to store heroes of the Three KingdomsheroTable: CREATE TABLE hero ( number INT, name VARCHAR(100), country varchar(100), PRIMARY […]