Solved

SQl Server Max Memory usage

Posted on 2014-09-14
5
197 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 45

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:ScottPletcher
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:
ScottPletcher 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

     When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a …
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

747 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

12 Experts available now in Live!

Get 1:1 Help Now