Solved

Use of  RAM by SQL 2012

Posted on 2015-01-23
6
110 Views
Last Modified: 2015-02-04
Hi,

It seems a common thread or belief that SQL will "use up" "ALL" of the available RAM given to a server.
And hand back to the OS as required/requested.

My understanding is that SQL will place the entire DBase into RAM if it can - also as queries come in + caching concurring it will try to use RAM.  So lets say your database/s are 2GB total. You then give server 64GB of RAM - and there are few queries. Would you say then that SQL 2012 would "eventually" consume "all" of the RAM - even though the server is massively over spec'd for RAM

My thought is that to have a blanket statement that SQL will simply use up ALL of the RAM provided is not correct. Can this be verified please
0
Comment
Question by:philb19
[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
6 Comments
 
LVL 17

Expert Comment

by:OriNetworks
ID: 40567755
I wouldnt say it will use ALL ram, but I routinely explain it as SQL Server will use as much as possible.
0
 

Author Comment

by:philb19
ID: 40567781
Ok thanks - So a 1GB SQL database will "possibly" use  1 TB RAM - not including memory leaks?
0
 
LVL 22

Expert Comment

by:Steve Wales
ID: 40567809
You specify minimum and maximum memory usage of the SQL instance in SQL Server Management Studio to cap the amount of memory used by the instance.

It defaults to a ridiculously high number.  Reset that down to an amount less than the physical installed for the machine, leaving space for the OS as well as anything else you're running on that machine.

Read the full document in SQL Server Books Online here: Server Memory Server Configuration Options
0
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
LVL 17

Expert Comment

by:OriNetworks
ID: 40567816
technically yes it will reserve as much ram as possible for things like buffers, cache plans, indexes,etc. As for your 1tb example,  i know it is an exaggeration but ram limitations are by version
https://msdn.microsoft.com/en-us/library/ms143685%28v=sql.105%29.aspx
0
 
LVL 70

Expert Comment

by:Qlemo
ID: 40569406
MSSQL will only use as much memory as is reasonable. Even if the DB is 2GB, 100 MB might be used by the server instance if other data is not selected regularly. If there is nothing more to cache or buffer, no memory gets allocated.
0
 
LVL 69

Accepted Solution

by:
Scott Pletcher earned 500 total points
ID: 40570858
SQL will only use the RAM it needs, and no more.  It doesn't grab RAM just because it's there.

Most dbs are far larger than the available RAM, and thus SQL gets "all" the RAM, because it can use it for data.

But, if the total db sizes are 2GB, SQL wouldn't use much more than 2GB total of RAM total for that instance, and it would get nowhere close to 64GB of RAM -- or even 10GB or RAM for that matter.
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

617 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