1

Is there any system catalog views or DMVs that can be used to query (in SSMS for example) below performance counters from SQL Server:Memory Manager ?

Free Memory (KB)
Target Server Memory
Total Server Memory
Maximum Workspace Memory (KB)
Database Cache Memory (KB)
Granted Workspace Memory (KB)
Lock Memory (KB)
Log Pool Memory (KB)
Optimizer Memory (KB)
Connection Memory (KB)
SQL Cache Memory (KB)
Reserved Server Memory (KB)
Stolen Server Memory (KB)
asked Oct 29, 2019 at 19:41
0

2 Answers 2

5

The information you seek is available in the DMV sys.dm_os_performance_counters.

select object_name, 
 counter_name, 
 instance_name, 
 cntr_value, 
 cntr_type
 from sys.dm_os_performance_counters
 where 1=1
 and [object_name] = 'SQLServer:Memory Manager'
answered Oct 29, 2019 at 19:47
0

Updated Kevinwhat's query, it will output values in Megabytes in descending order, only those counters that I am interested in:

select
 replace(counter_name,' (KB)','') [counter_name],
 cntr_value / 1024 [MB] 
from sys.dm_os_performance_counters
where [object_name] = 'SQLServer:Memory Manager'
 and counter_name not in ('External benefit of memory','Lock Blocks Allocated','Lock Owner Blocks Allocated','Lock Blocks','Lock Owner Blocks','Memory Grants Outstanding','Memory Grants Pending')
order by [MB] desc
answered Nov 1, 2019 at 9:36

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.