Sql Server : Memory

HKN MZ
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);

--

--

HKN MZ

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