Missing Memory on Windows Server 2008
I have a windows 2008 x64 server with 8GB of RAM installed.
Task Manager and Resource Monitor both insist that 7.5GB of the RAM is in use. However, the memory list under Processes (Memory Private Bytes) doesn't add up. I do have Show Processes from all users checked and hand adding the numbers I come up with about 3.5GB of RAM.
I also looked at the latest copy of SysInternals Process Explorer. And neither the Private Bytes or Working Set adds up to more than about 3.5GB of RAM in use.
What's going on?
=====
Update: I bounced the server to see what would happen with the memory utilization. After boot and regular operations began it sat at 3GB of RAM usage. 18 hours later, it's back up to 6.8GB of usage with no indication as to where the additional 3.5GB or so of RAM is being used.
Here are links to screen shots of the resource monitor and task manager:
Resource Monitor
Task Manager
Update 2: Well, I believe I located the problem. When I detached one of the larger databases from my sql server the amount of ram shown as "in use" dropped drastically. The Memory Private Bytes count barely moved. So I'm guessing that SQL server has some way of allocating memory where it doesn't really show up in any of the monitors.
I went further and created a new database file, then transferred all of the data from the one I detached. Even though it has the same data, and the same transactions going through it, the memory in use has stayed low. Maybe there was some corruption in the DB? I'll leave it to the DB gods and go searching for another "problem" ;)
Solution 1:
I found this article today which discusses in detail locked pages, AWE, and 64 bit systems. http://blogs.msdn.com/psssql/archive/2009/09/11/fun-with-locked-pages-awe-task-manager-and-the-working-set.aspx
One of the bullet points (#3) is title "Why is task manager not showing all of the memory allocated for SQL Server"
It's a very nice explanation. In the end the reason this doesn't show up is that sql server has "locked" those pages in memory. Locked pages are NOT part of the working set so they won't appear in Task manager or even appear as part of the applications memory set.
If you run select * from sys.dm_os_process_memory
you can see the locked_page_allocations_kb field which will tell you how much RAM sql server has allocated in those pages.
Solution 2:
Task Manager has a memory bar/graph below the CPU bar/graph. This is the amount used by applications.
The sum of the amount indicated by that graph and the amount indicated as "Available" should equal your 8GB total.
"Available" is more than "Free" because "Cached" is included in "Available".