How to know memory usage in SQL Server?

We can find out memory usage of SQL Server by using below scripts.

      total_physical_memory_kb/1024 AS total_physical_memory_mb,
      available_physical_memory_kb/1024 AS available_physical_memory_mb,
      total_page_file_kb/1024 AS total_page_file_mb,
      available_page_file_kb/1024 AS available_page_file_mb,
      100 - (100 * CAST(available_physical_memory_kb AS DECIMAL(18,3))/CAST(total_physical_memory_kb AS DECIMAL(18,3)))
      AS 'Percentage_Used',
from  sys.dm_os_sys_memory;


After executing of above script we get the output like below:-

How to know memory usage in SQL Server?


2. We can also use below query to find out memory usage of SQL server by using sys.dm_os_process_memory dmv.

select * from sys.dm_os_process_memory;


After execution  of above we will get the output of memory usage in kb.



Leave a Reply

Your email address will not be published. Required fields are marked *