LLI Wiki — My Digital Knowledge Base

Physical memory and memory used by SQL Server

Two T-SQL queries that return the physical memory of the server and the memory used by SQL Server, in gigabytes.

Two queries that return the physical memory of the server, the memory committed by SQL Server, and the total server memory used by the SQL Server instance.

SELECT physical_memory_kb/1024.0/1024.0, committed_kb/1024.0/1024
FROM sys.dm_os_sys_info;

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

Reading the results

Mastodon LLIMastodon SocialFosstodon