Inconsistent information from different DMVs
-
22-10-2019 - |
Question
I've a server with 12 GB of physical RAM. I just lowered its 'Max Server Memory (MB)'
setting from 10 GB to 8 GB.
If I look at the processes' committed memory in Perfmon, I see:
select *
from sys.dm_os_performance_counters
where [object_name] like 'SQLServer:Memory Manager%';
go
Target Server Memory (KB): 8388608 Total Server Memory (KB): 8388608
Showing that SQL Server has already relased the additional 2 GB of memory from the Buffer Pool.
However, if I look at the sys.dm_os_sys_info
:
select [bpool_committed]
, [bpool_commit_target]
, [bpool_visible]
from sys.dm_os_sys_info;
go
I get inconsistent results:
bpool_committed = 1048576 bpool_commit_target = 1048576 bpool_visible = 1048576
Shouldn't sys.dm_os_sys_info
reflect the information on the performance counters?
I'm running Microsoft SQL Server 2005 SP1 on Windows Server 2003.
Solution 2
The values were indeed inconsistent and went back to normal after an instance restart.
I recommend not using the sys.dm_os_sys_info
for this kind of information since it's not reliable and use the performance counters instead.
OTHER TIPS
There is no inconsistency:
1048576 * 8 = 8388608 KB => 8 GB;
Both Perfmon and sys.dm_os_sys_info
show 8 GB;
[bpool_visible], [bpool_commit_target] and [bpool_committed]
- in SQL 2005 all these are defined as "Number of 8-KB buffers ..." (http://msdn.microsoft.com/en-us/library/ms175048(v=sql.90).aspx), so you have to multiply the result by 8 to get KB; Starting with SQL 2008 R2 you no longer have to do the multiplication.
If you want to use a multiplication within the query try:
SELECT CAST((bpool_committed * 8) / (1024.0 * 1024.0) AS DECIMAL(20, 2)) AS buffer_pool_committed_memory_in_GB
, CAST((bpool_commit_target * 8) / (1024.0 * 1024.0) AS DECIMAL(20, 2)) AS buffer_pool_target_memory_in_GB
, CAST((bpool_visible * 8) / (1024.0 * 1024.0) AS DECIMAL(20, 2)) AS buffer_pool_visible_memory_in_GB
FROM sys.dm_os_sys_info;