Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a SQL Server 2008 (ver 10.0.1600) running on a Windows Server 2008 R2 Enterprise server with 8 GB of physical ram. If I open Task Manager I can see on 'Physical Memory' section of 'Performance' tab that only 340 MB are Available of 8191 Total, but I can't see any process using such amount of memory. Please note SQL Server is memory limited to 6GB (Maximum Server Memory = 6000).

If I open Sysinternals Process Explorer, I can see sqlsrvr.exe process has:

Private Bytes:  227.000 K
Working Set:    140.000 K
Virtual Size: 8.762.000 K

What does this means? Is there any way to free up this memory for other process? Why Virtual Size figure as allocated memory? I thought that Virtual Size was 'reserved memory' only.

share|improve this question
add comment

2 Answers

This is normal. SQL server will always use all available memory, and scale back when the system needs more resources.

THIS article describes what is going on.

When you start SQL Server, SQL Server memory usage may continue to steadily increase and not decrease, even when activity on the server is low. Additionally, the Task Manager and Performance Monitor may show that the physical memory available on the computer is steadily decreasing until the available memory is between 4 to 10 MB.

This behavior alone does not indicate a memory leak. This behavior is normal and is an intended behavior of the SQL Server buffer pool.

By default, SQL Server dynamically grows and shrinks the size of its buffer pool (cache) depending on the physical memory load reported by the operating system. As long as enough memory is available to prevent paging (between 4 - 10 MB), the SQL Server buffer pool will continue to grow. As other processes on the same computer as SQL Server allocate memory, the SQL Server buffer manager will release memory as needed. SQL Server can free and acquire several megabytes of memory each second, allowing it to quickly adjust to memory allocation changes.

share|improve this answer
add comment

Because of the way SQL Server allocates memory (particularly with AWE enabled), Task Manager and Process Explorer will not give you an accurate indication of how much RAM it's actually using. To get the proper figures, you have to ask SQL Server directly. The easy way to do that is run perfmon, and add the counter SQLServer:Memory Manager/Total Server Memory. That counter will report the total memory usage in KB.

Now, if SQL Server is using the full 6000 MB that it's limited to, then that's perfectly normal (and desirable) behavior. If it's using substantially more than that, then there might be a problem.

share|improve this answer
    
Total Server Memory shows 6 GB so this is correct as Maximum Server Memory is 6 GB. So why Virtual Size is 8.762.000 K? Can't understand this point. –  Danilo Brambilla Feb 23 '11 at 16:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.