Monitoring System Memory Usage in SQL Server

sys.dm_os_sys_memory is a dynamic management view (DMV) in SQL Server that returns information about the overall memory state of the system. It includes details about how much memory is available, how much is being used, and how much is reserved for SQL Server.


Key Columns:

  • available_physical_memory_kb: Physical memory available to the system.
  • available_virtual_memory_kb: Virtual memory available to the system.
  • total_physical_memory_kb: Total physical memory installed on the system.
  • total_page_file_kb: Total size of the page file (swap file).
  • total_virtual_memory_kb: Total virtual memory available to the system.
  • physical_memory_in_use_kb: Physical memory currently used by SQL Server.


Use Case:

This view is useful for monitoring SQL Server’s memory usage at the system level. It helps you understand how much memory SQL Server is consuming relative to the physical and virtual memory of the operating system.


Example Query:

SELECT * 
FROM sys.dm_os_sys_memory;