简体   繁体   中英

Minimum and maximum memory usage in SQL Server?

I've been looking around but my google-fu isn't too good these days it seems. I'm trying to find more information about the minimum and maximum memory settings for SQL Server instances.

If you open SQL Server Management Studio, right-click on an instance, and go to the 'Memory' tab in the left-hand menu, you can find both Maximum and Minimum memory for the instance. I understand that this sets the memory usage of the SQL Server instance to use at most (and at least) so and so much memory. However, what does this imply?

Let's say that I have a machine with 8 GB of memory that I install SQL Server on. I set the instance to have both minimum and maximum memory to 5 GB, so this should in theory mean that SQL always uses 5 GB of memory. My question revolves around the minimum setting. If no application is connected to the SQL Server instance and writing/reading data from the database, surely the allocated 5 GB cannot really be in use, can it? My understanding is that this minimum setting is just "this much memory is dedicated for SQL Server in case you need it".

Let's say an application connects to the SQL Server database and requires 2 GB of memory. Will the total memory usage still be 5 GB? My guess is yes but I have colleagues saying that this will then be 5 GB for the SQL Server instance and an additional 2 GB for the application's usage of the SQL Server instance.

If anyone has some information that you can point me to it would be greatly appreciated.

Let's say that I have a machine with 8 GB of memory that I install SQL Server on. I set the instance to have both minimum and maximum memory to 5 GB, so this should in theory mean that SQL always uses 5 GB of memory

SQLServer(remeber it is an EXE) will cap its memory limit to 5GB and many components like

1.Buffer pool
2.plan cache..

will try to compete for the available 5GB memory.

Now that you have 3GB left,there are other components like..

1.Os itself
2.Linked servers
3.Extended stored procs
3.third party dlls or addins
4.Database email
4.SSIS
5.SSRS

try to compete for the 3GB memory available..

Let's say an application connects to the SQL database and requires 2 GB of memory. Will the total memory usage still be 5 GB?

The concept of your application requiring 2GB is not clear to me,but imagine ,so many queries which need huge memory are running in parallel ,SQL will stick to its limited Quota,but other components will starve like buffer pool,plan cache ...

Read about effects of MIN and Max Memory and Buffer management for more understanding

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM