Finding current memory consumption of SQL Server
Posted: (EET/GMT+2)
Sometimes, it is useful to determine the current memory consumption values of an SQL Server installation. SQL Server contains many useful system views that can give you useful information about the system overall. One of such useful functions is the "dm_os_process_memory" dynamic management view (DMV).
You can query these DMVs using regular SQL commands. For example:
SELECT (physical_memory_in_use_kb/1024) AS 'Current Memory Usage (MB)', (available_commit_limit_kb/1024) AS 'Commit Limit (MB)', memory_utilization_percentage AS 'Memory Utilization (%)' FROM sys.dm_os_process_memory
This will report the current amount of memory (in MB, or rather MiB) use by the SQL Server instance, the commit limit and finally, the memory utilization percent used by SQL Server.
For more information, see the documentation of the documentation. The first two values returned by the query are "bigint"s.