LLI Wiki — My Digital Knowledge Base

SQL Server: check process memory, locked pages and VAS

Query on sys.dm_os_process_memory showing physical memory, locked pages and virtual address space used by SQL Server.

To check how SQL Server uses memory (physical memory, locked pages, virtual address space) and whether it is under memory pressure, for example when troubleshooting PAE, AWE or /3GB issues, query the sys.dm_os_process_memory DMV.

SELECT
(physical_memory_in_use_kb/1024) AS Memory_usedby_Sqlserver_MB,
(locked_page_allocations_kb/1024) AS Locked_pages_used_Sqlserver_MB,
(total_virtual_address_space_kb/1024) AS Total_VAS_in_MB,
process_physical_memory_low,
process_virtual_memory_low
FROM sys.dm_os_process_memory;

Columns

Column Meaning
physical_memory_in_use_kb physical memory used by the SQL Server process
locked_page_allocations_kb memory allocated as locked pages (Lock Pages in Memory); 0 if the privilege is not used
total_virtual_address_space_kb total size of the process virtual address space
process_physical_memory_low 1 if the process reports low physical memory
process_virtual_memory_low 1 if the process reports low virtual address space

KB values are divided by 1024 to read them in MB.

Further reading

Mastodon LLIMastodon SocialFosstodon