Solved

Use of  RAM by SQL 2012

Posted on 2015-01-23
6
98 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
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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 68

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:
ScottPletcher 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now