Solved

SQL Server 2008 Memory Question?

Posted on 2011-02-23
12
563 Views
Last Modified: 2012-05-11
We wanted to change the memory setting for a SQL Server Instance on a particular server. The settings for the way our SQL Server 2008 Instance uses memory was set to minimum 0 to maximum 10GB so we changed it to minimum 5GB to maximum 10GB. When the Sys Admin monitored this server after making the change it was not using minimum 5GB. We did not restart the SQL Server 2008 services or reboot the server after making the SQL Server 2008 memory change. Why isn't grabbing and holding the minimum of 5GB?
0
Comment
Question by:Omega002
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
12 Comments
 
LVL 6

Accepted Solution

by:
anushahanna earned 250 total points
ID: 34961770
how are you checking the memory usage?

this is an accurate code to check it:

SELECT
(sum(multi_pages_kb) +sum(single_pages_kb)+      sum(virtual_memory_committed_kb) +   sum(virtual_memory_reserved_kb)+sum(awe_allocated_kb) + sum(shared_memory_reserved_kb)+sum(shared_memory_committed_kb))/(1024*1024) Mem_Used_By_SQL_In_GB
FROM sys.dm_os_memory_clerks

http://msdn.microsoft.com/en-us/library/ms175019.aspx
0
 
LVL 4

Assisted Solution

by:rocky_lotus_newbie
rocky_lotus_newbie earned 250 total points
ID: 34961795
From BOL,

"Use min server memory to guarantee a minimum amount of memory available to the buffer pool of an instance of SQL Server. SQL Server will not immediately allocate the amount of memory specified in min server memory on startup. However, after memory usage has reached this value due to client load, SQL Server cannot free memory from the allocated buffer pool unless the value of min server memory is reduced."    (http://msdn.microsoft.com/en-us/library/ms178067(v=SQL.100).aspx)
0
 

Author Comment

by:Omega002
ID: 34962047
If  I set SQL Server 2008 Server minimum server memory to 5GB and maximum 10GB will SQL Server 2008 immediately grab 5GB as minimum or not?  
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 4

Assisted Solution

by:rocky_lotus_newbie
rocky_lotus_newbie earned 250 total points
ID: 34962113
No it will not grab the 5GB as minimum memory immediately. Once the client load reaches 5GB and above, only then will the SQL Server grab it and SQL Server doesn't free any memory from the buffer pool after that until you change the min memory setting. Let me know if it's still not clear
0
 
LVL 4

Assisted Solution

by:rocky_lotus_newbie
rocky_lotus_newbie earned 250 total points
ID: 34962127
To add to my above post, SQL Server is not guaranteed to allocate the amount of memory specified in min server memory. If the load on the server never requires allocating the amount of memory specified in min server memory, SQL Server will run with less memory.
0
 

Author Comment

by:Omega002
ID: 34962213
So is that a good practice to have SQL grab that amount of memory whenever it is reached and never release until memory setting is reduced from a performance point of view? Would it be best to just have minimum as 0 and max as 10GB?
0
 
LVL 4

Assisted Solution

by:rocky_lotus_newbie
rocky_lotus_newbie earned 250 total points
ID: 34962307
Are there any other memory intensive processes along with SQL Server running on that server?
0
 

Author Comment

by:Omega002
ID: 34964323
no but we also notice that when we changed the memory settings, SQL Server is using all the memory so why is that occurring?
0
 
LVL 6

Assisted Solution

by:anushahanna
anushahanna earned 250 total points
ID: 34964466
sql server is memory hungry; if you don't give it, it will do its best within the limitation;but if you give it, then it is going to take it all and give it not back.

that is where the min/max is a great help, especially if other applications are also on the box. That is why it is good to have dedicated box for sql server. In that case, whether you keep min as 0 or 5 GB will not matter. but if there are other apps, then it matters.

0
 
LVL 6

Expert Comment

by:anushahanna
ID: 34964470
did you run the first query? what is the value you got?
0
 
LVL 6

Assisted Solution

by:anushahanna
anushahanna earned 250 total points
ID: 34964490
>>SQL Server is using all the memory
This will tell you where it is using it.
DBCC MEMORYSTATUS

there are lot of internal mechanism /architecture which consume them.
0
 
LVL 6

Assisted Solution

by:anushahanna
anushahanna earned 250 total points
ID: 35000315
Omega002, were you able to see how much memory your instance is using? let us know if you have any questions on the above.
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
sql query 5 44
sql server cross db update 2 20
access to sql migration 5 23
8 hour Continual coverage based on Time in and Time Out 9 20
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how the fundamental information of how to create a table.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question