Solved

SQl Server Max Memory usage

Posted on 2014-09-14
5
208 Views
Last Modified: 2014-09-16
Hello experts,

I am looking into a SQL Server's performance outputs and I see an inconsistency with the following metrics.

1. When I query the physical memory in use by SQL with the following query, I get '8342' in MB:
SELECT
(physical_memory_in_use_kb/1024) AS Memory_usedby_MSSQL_MB,
FROM sys.dm_os_process_memory;

2. The SQL Server memory usage max and min values are set to 8000 and 0 respectively. I verify that both from UI and following SQL query:
SELECT name, value, value_in_use, [description]
FROM sys.configurations
WHERE name like '%server memory%'
ORDER BY name OPTION (RECOMPILE);

3. I am not sure if the SQL Server Services are restarted after the memory max and min is set. I believe they are but I cannot be 100% sure.

My question is, how come the physical memory used is higher than the max value. (Usage 8342 and max set is only 8000) What will be my next steps to troubleshoot the issue?

Thank you in advance
0
Comment
Question by:bozer
  • 2
  • 2
5 Comments
 
LVL 47

Expert Comment

by:Vitor Montalvão
ID: 40322553
That's strange.
Can you check how much percentage of the MAX memory are in use?
select memory_utilization_percentage
from sys.dm_os_process_memory

Open in new window

0
 
LVL 69

Expert Comment

by:Scott Pletcher
ID: 40323419
Max memory applies only to SQL buffers.  That is the vast majority of the RAM SQL uses, but not all of it.  There will be some modest RAM usage outside the buffers that will not be affected by the max memory setting.

Btw, you don't need to restart SQL Server instance to apply new memory settings, just RECONFIGURE.  If you lower the max setting, SQL may take some time to release the RAM, it doesn't even try to immediately reduce its RAM usage.
0
 

Author Comment

by:bozer
ID: 40324519
Hello Vitor, your query returns 100%

Scott, based on your explanation, is it safe to say it will not 'in theory' go too much beyond those numbers (8342) assuming 342 is the other SQL software usage type? I appreciate if you have an online article or something similar for this.

Also, I highly suspect this configuration is completed over UI. I know 'RECONFIGURE' is a part of the TSQL way of making this configuration. Is it still required to run the query on top of UI changes or does UI takes care of it?

Thanks
0
 
LVL 69

Accepted Solution

by:
Scott Pletcher earned 500 total points
ID: 40325602
Check Books Online under "max server memory option".  Yes, RAM typically won't go much beyond that.  Certain special cases can drive it up, for example, if you have *lots* of linked servers and "Allow inprocess" is left unchecked.

Correct, the UI automatically applies the "RECONFIGURE" for you, so you do not need to run it separately.
0
 

Author Closing Comment

by:bozer
ID: 40325729
Thanks, I was able to understand the difference with your explanation.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Audit has been really one of the more interesting, most useful, yet difficult to maintain topics in the history of SQL Server. In earlier versions of SQL people had very few options for auditing in SQL Server. It typically meant using SQL Trace …
Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

832 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