Solved

Use of  RAM by SQL 2012

Posted on 2015-01-23
6
100 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

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.
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

815 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

8 Experts available now in Live!

Get 1:1 Help Now