is allocated memory taken from Virtual memory reserved or its different.

SQLDBA 0 Reputation points
2025-07-10T06:32:35.12+00:00

if you see the screenshot , the buffle pool memory clerk, the allocated memory, Virtual memory reserved and virtual memory committed.

I am confused if the allocated memory taken from virtual memory, or allocated memory is taken from OS and Virtual memory reserved is reserved from OS but not used yet.

SQL Server Database Engine
0 comments No comments
{count} votes

Accepted answer
  1. Erland Sommarskog 122K Reputation points MVP Volunteer Moderator
    2025-07-10T07:59:40.61+00:00

    No, we don't see the screenshot.

    The allocated memory is taken from the virtual memory, but hopefully never exceeds the available physical memory.

    The virtual memory is just how much memory that is addressable in total. And which can exceed the physical memory, being backed up by the page file. But the whole point of the buffer cache is to have the data more quickly accessible than having to read it from disk. So reading data from data file and then store it in the page file is not a smart move, so SQL Server does not want to do that. And if the OS decides to evict SQL Server's memory to the page file, SQL Server writes a warning to the errorlog file.

    The equation changes if the SQL Server account has the Windows privilege "Lock pages in memory". With this permission, SQL Server cannot be paged out.


1 additional answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 78,236 Reputation points Volunteer Moderator
    2025-07-10T15:58:58.5233333+00:00

    windows supports virtual paged memory. virtual memory can be larger than physical memory. memory is written to the page file when swapped out. so the max virtual memory size is based on the pageful size and the max addressable memory.

    when looking at an application, it can reserve virtual memory pages which makes the memory available. it committed when the page is actually accessed.

    SQLServer does it own internal memory management using buffer pools rather than say the C/C++ heap. When you display memory usage, it displays how the buffer pool is used. it tries allocate all its memory at startup. so allocated memory is how much memory it has allocated (this is virtual memory). the buffer pool has used and free blocks.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.