principlesqlMinor
SQL Server: allocated vs reserved vs commited
Viewed 0 times
commitedsqlserverallocatedreserved
Problem
What exactly is the memory that is allocated to the a memory component in SQL Server?
I believed
But I am puzzled when it comes to
Here is an example DMV:
There is no relationship whatsoever between columns A, C and R. Initially I was expecting
How do I interpret allocated memory? Thanks
I believed
committed memory is the amount of physical memory that is being used, and reserved is the amount of memory in Virtual Address Space that does not yet map to physical memory.But I am puzzled when it comes to
allocated memory. When a memory component requests memory from a Memory Manager, what is the nature of this memory being granted? Real/Physical or VAS?Here is an example DMV:
SELECT pages_kb AS A
,virtual_memory_committed_kb AS C
,virtual_memory_reserved_kb AS R
FROM sys.dm_os_memory_clerks;There is no relationship whatsoever between columns A, C and R. Initially I was expecting
A = C + R, which implied that A, the allocated memory pages, should start out as memory in VAS, and represent the intent to use this much of memory. But clearly it is not right.How do I interpret allocated memory? Thanks
Solution
What exactly is the memory that is allocated to the a memory component in SQL Server?
Memory allocated is memory given to SQL Server for doing various processing. Allocation is wide terms which means providing memory you should not attach any specific meaning to it.
You are correct committed memory is physical memory used because committed memory is backed by physical memory while reserved memory is memory reserved by process which it thinks it might need it may necessarily not be committed.
When a memory component requests memory from a Memory Manager, what is the nature of this memory being granted? Real/Physical or VAS?
VAS: Virtual address space is total amount of virtual memory a process can see in the system when created.
When SQL Server process requests memory it is first mapped to VAS address in the region. VAS is 8TB for 64 bit system and 4 GB for 32 Bit system. Every process which requests memory sees virtual memory which equal to 4GB or 8 TB as per architecture(32 or 64 bit) it is running on. Now after process is mapped to VAS memory manager finds out physical memory to which it can be mapped and finally commit memory to this process when this is eventually done the memory is allocated and is called physical memory allocated to process.
Virtual_memory_committed: This is virtual memory committed as reported by the clerk.
Virtual_memory_reserved: This is the VM reserved as tracked by the clerk..
Pages_kb: Amount of page memory allocated to process.
I hope this clears few things for you
Memory allocated is memory given to SQL Server for doing various processing. Allocation is wide terms which means providing memory you should not attach any specific meaning to it.
You are correct committed memory is physical memory used because committed memory is backed by physical memory while reserved memory is memory reserved by process which it thinks it might need it may necessarily not be committed.
When a memory component requests memory from a Memory Manager, what is the nature of this memory being granted? Real/Physical or VAS?
VAS: Virtual address space is total amount of virtual memory a process can see in the system when created.
When SQL Server process requests memory it is first mapped to VAS address in the region. VAS is 8TB for 64 bit system and 4 GB for 32 Bit system. Every process which requests memory sees virtual memory which equal to 4GB or 8 TB as per architecture(32 or 64 bit) it is running on. Now after process is mapped to VAS memory manager finds out physical memory to which it can be mapped and finally commit memory to this process when this is eventually done the memory is allocated and is called physical memory allocated to process.
Virtual_memory_committed: This is virtual memory committed as reported by the clerk.
Virtual_memory_reserved: This is the VM reserved as tracked by the clerk..
Pages_kb: Amount of page memory allocated to process.
I hope this clears few things for you
Context
StackExchange Database Administrators Q#177207, answer score: 2
Revisions (0)
No revisions yet.