Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Possible Duplicate:
SQL Server 2008 R2 “Ghost Memory”?

Context:

  • Windows Server 2008 R2;
  • 32GB RAM;
  • Application: SQL Server 2008 R2, several Connectors to Write Data into SQL Server(Write Frequency: 0.5HZ);
  • The Server has not been restart for more than half a year;
  • About 15G Data per month;
  • Support Several Applications hosted on other Server(Web Applicaion, Socket Application);

Edit:

  • Problem(From the Task Manager): In the Performance Tab, The Memory Display and the Physical Memory Usage History Chart both show that the memory usage is approaching 100%(96%); While in the Process Tab, in which the Memory(Private Working Set) Column is shown by default, and the Memory(Private Working Set) Usage of sqlservr.exe is realtively small(200-300M), the total Memory(Private Working Set) usage of all the Processes added up is normal as well(less than 10%).

  • Maybe the problem is that I just check the Memory(Private Working Set) Column, but I don't have access to the Server right now

share|improve this question
    
So SQL Server's private working set memory is low? –  marceln Jul 7 '12 at 7:19
    
yes, I believe so. –  Dean Jul 7 '12 at 8:10
    
Why? You do not say anything how the memory is distributed. –  TomTom Jul 7 '12 at 9:53
    
guys, see the edit please. –  Dean Jul 7 '12 at 11:44
add comment

migrated from stackoverflow.com Jul 8 '12 at 1:01

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Mark Storey-Smith, Aaron Bertrand, ConcernedOfTunbridgeWells, gbn, ypercube Jul 8 '12 at 20:19

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3 Answers

is there some kind of memory-leak problems here?

No, the problem is more someone who does not know how SQL Server works.

SQL Server uses as much memory as feasible as cache for the database. Why not use it? So, what happens basically is that SQ LServer has a lot of data in memory in case it needs it, to avoid accessing the disc.

If you need more free memory, set a memory limit in SQL Server properties.

If oot - be happy, your memroy is used.

share|improve this answer
    
So, it is normal that the memory usage of sqlservr.exe process is just about 1GB while the total physical memory usage is 96%(of 32GB)? Where can i check how much memory is used as cache for Sql Server? –  Dean Jul 7 '12 at 7:57
    
? You do not say anything like that. Maybe you should post some screenshots showing how the memory is distributed. –  TomTom Jul 7 '12 at 9:54
    
1GB(actually less than 1GB) of sqlservr.exe process is what's shown in the Memory(Private Working Set) Column in the Process Tab of the Task Manager, 96% is the from the Performance Tab. I don't have access to the Server right now, but i'll check the detail. –  Dean Jul 7 '12 at 11:49
    
Then it is not sql server - you need to tell us WHAT uses the memory. –  TomTom Jul 7 '12 at 12:03
add comment

The real problem here is Task Manager - it is a dirty, filthy liar.

Chances are you have Lock Pages in Memory granted within SQL Server. Task Manager has no idea about this, so it shows you a smaller amount of memory usage. You probably have not set a max memory setting for SQL server, either.

You can use Glenn Berry's diagnostic queries to better determine what is using up your memory within SQL Server.

share|improve this answer
add comment

Any decent OS will use all free memory for disk cache. It can take some time to fill up 32 GB but eventually it will. It is much better to look at swap space usage. As long as it is using only a little swap everything is fine (somethings will cause swap usage even if there is enough memory).

If you would increase the memory usage of sqlserver you probably will see that the total memory usage will still be around 96% as the OS will shrink it's cache to free memory for sqlserver.

Also beside the private working set there is also shared memory for things like binaries shared by multiple processes. So the private working set is not all that is used.

share|improve this answer
add comment