简体   繁体   English

服务器总内存-通过SQL Server获取内存的最准确方法是什么?

[英]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 物理内存是该服务器上具有的总RAM

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 您可以使用以下方法比较SQL Server服务消耗的内存量:sys.dm_os_sys_info系统视图commit_kb字段和sys.dm_os_performance_counters视图cntr_value

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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