简体   繁体   中英

Total server memory - what is the most accurate way to get it through SQL Server?

How is it that the values of these 2 queries disagree between each other:

SELECT [server memory] = physical_memory_in_bytes /1024.00/1024.00/1024.00
FROM sys.dm_os_sys_info;

SELECT object_name, cntr_value 
FROM sys.dm_os_performance_counters
WHERE counter_name = 'Total Server Memory (KB)';

they should both be showing the total server memory.

Why do they disagree?

在此处输入图片说明

在此处输入图片说明

Physical memory is the total RAM on that server has

You can compare how much memory is SQL Server service is consuming using: sys.dm_os_sys_info system view committed_kb field and sys.dm_os_performance_counters view cntr_value

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM