Sql Server : Memory

3 min readDec 26, 2023

This SQL query retrieves information about the system memory on a SQL Server instance using the sys.dm_os_sys_memory dynamic management view.

SELECT total_physical_memory_kb/1024 AS [Physical Memory (MB)], 
available_physical_memory_kb/1024 AS [Available Memory (MB)],
total_page_file_kb/1024 AS [Total Page File (MB)],
available_page_file_kb/1024 AS [Available Page File (MB)],
system_cache_kb/1024 AS [System Cache (MB)],
system_memory_state_desc AS [System Memory State]
FROM sys.dm_os_sys_memory WITH (NOLOCK) -- OPTION (RECOMPILE);




I am writing about Sql Server, Elasticsearch and Python. İ am an Database Administrator on SQL Server and Elasticsearch more than 5+ years.