Solved

Use of  RAM by SQL 2012

Posted on 2015-01-23
6
104 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
Backup Solution for AWS

Read about how CloudBerry Backup fully integrates your backups with Amazon S3 and Amazon Glacier to provide military-grade encryption and dramatically cut storage costs on any platform.

 
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 69

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
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.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

762 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