Solved

Use of  RAM by SQL 2012

Posted on 2015-01-23
6
99 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
Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

 
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

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.

Question has a verified solution.

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

Suggested Solutions

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
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…
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…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

932 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

11 Experts available now in Live!

Get 1:1 Help Now