I am trying to understand the memory management of SQL Server. I have a Windows Server 2019 on virtual environment with 64 GB of RAM. I also have SQL Server 2019 installed with Max Server Memory 59776 MB. By using the following query I found the list of all
memory clerks:
SELECT [type] AS [ClerkType], SUM(pages_kb) / 1024 AS [SizeMb]
FROM sys.dm_os_memory_clerks WITH (NOLOCK)
GROUP BY [type]
ORDER BY SUM(pages_kb) DESC
Total sum of all memory clerks was equal to 23523 MB.
Value for MEMORYCLERK_SQLBUFFERPOOL memory clerk is 18387 MB.
I also checked some performance counters:
Total Server Memory (KB) = 32262 MB.
Database Cache Memory (KB) = 18387 MB.
Please correct me if any of the below statements are wrong,
Max Server Memory for SQL Server 2019 = Buffer Pool Memory + Non-Buffer Pool Memory.
Total Server Memory (KB) - The committed memory from the Buffer Pool.
Data Cache Memory (KB) performance counter is equivalent to MEMORYCLERK_SQLBUFFERPOOL memory clerk and both represents data cache used size.
Above query shows all memory clerks for both Buffer Pool Memory and Non-Buffer Pool Memory.
My question related to this subject:
If Total Server Memeory (KB) is related to Buffer Pool memory, then why its size (32262 MB) is bigger than Total sum memory clerks altogether (23523 MB) which represents both Buffer Poll Memory and Non-Buffer Pool Memory?
EDIT: Result of select * from sys.dm_os_process_memory
physical_memory_in_use_kb = 38065556
large_page_allocations_kb = 333824
locked_page_allocations_kb = 37424380
total_virtual_address_space_kb = 137438953344
virtual_address_space_reserved_kb = 114125108
virtual_address_space_committed_kb = 38942228
virtual_address_space_available_kb = 137324828236
page_fault_count = 473391
memory_utilization_percentage = 100
available_commit_limit_kb = 33175136
process_physical_memory_low = 0
process_virtual_memory_low = 0