Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 123»»»

Max Memory Expand / Collapse
Author
Message
Posted Wednesday, September 11, 2013 5:12 PM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Wednesday, October 30, 2013 6:42 PM
Points: 667, Visits: 2,055
I have set Max Memory to 6 GB. But SQL Server is using only 2.9 GB

Query used:

SELECT object_name, counter_name, cntr_value AS 'Total Server Memory (KB)'
FROM sys.dm_os_performance_counters
WHERE counter_name = 'Total Server Memory (kB)'

So why SQL Server is not using all allocated Max memory i.e 6GB?

Is this normal? SQL Server should use all allocated Max memory right?

Thanks,
Gary
Post #1493948
Posted Wednesday, September 11, 2013 5:22 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 2:48 AM
Points: 42,438, Visits: 35,493
Max server memory is just the upper limit that SQL is allowed to use. There's many cases where it won't reach that. Ones that immediately come to mind is it doesn't need that much memory or that that much memory is not available.


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1493951
Posted Wednesday, September 11, 2013 5:40 PM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Wednesday, October 30, 2013 6:42 PM
Points: 667, Visits: 2,055
Max server memory is just the upper limit that SQL is allowed to use. There's many cases where it won't reach that. Ones that immediately come to mind is it doesn't need that much memory or that that much memory is not available
.

Thanks Gail.

We have 2 SQL Serve instances on same server, SQL Server 2008 R2 with SP1. The server has 16 GB RAM

For both instances Max Memory is set 6GB and 4GB is left OS

But instance1 is using 2.9 GB out of 6GB and instance2 is using 763 MB out of 6GB.

Issue: PLE is dropping <5 minsfor every 15 to 20 mins and there is no much activity (no active sessions)on the server and also noticed CPU is going 80% when PLE drops to <5 mins

Please advise why SQL Server is not utilizing memory allocated to it? By design, SQL Sever should use all of its max memory right?

Thanks,
Gary
Post #1493952
Posted Wednesday, September 11, 2013 10:38 PM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Wednesday, October 30, 2013 6:42 PM
Points: 667, Visits: 2,055
Hi Gail.

I just noticed that instance1 is using 364 MB out of 6GB (it was 2.9 GB 6 hrs back) and instance2 is using 3.4 GB out of 6GB.(it was 763 MB 6 hrs back)

I did not understand why this is changed in last 6 hours. Please advice..

Post #1493993
Posted Thursday, September 12, 2013 12:55 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 2:48 AM
Points: 42,438, Visits: 35,493
gary1 (9/11/2013)
By design, SQL Sever should use all of its max memory right?


As I said above, no. There is no guarantee that SQL will use max server memory, it's just a maximum. The default value for that setting (2000 TB) makes that clear enough

Can't diagnose what's happening, there's no where near enough information. Start by looking at what else is consuming memory on the server. You'll probably need run counter traces for hours. Also look at the ring buffers in SQL.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1494011
Posted Thursday, September 12, 2013 11:12 AM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Wednesday, October 30, 2013 6:42 PM
Points: 667, Visits: 2,055
Thanks Gail,


I just noticed that instance1 is using 364 MB out of 6GB (it was 2.9 GB 6 hrs back) and instance2 is using 3.4 GB out of 6GB.(it was 763 MB 6 hrs back)



In which scenarios, sql server instance will release it's memory other than it's service restarts?

Min memory is set to zero. Do we need to set Min memory if we have multiple instances?
Post #1494295
Posted Thursday, September 12, 2013 11:31 PM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Wednesday, October 30, 2013 6:42 PM
Points: 667, Visits: 2,055
Gail,

Issue got resolved after setting up the Min memory to 1gb for both the instances

Can you please shed some light on this Min memory setting? i.e which scenarios we need to set this?


Post #1494441
Posted Friday, September 13, 2013 5:03 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 2:48 AM
Points: 42,438, Visits: 35,493
gary1 (9/12/2013)
In which scenarios, sql server instance will release it's memory other than it's service restarts?


When windows is under memory pressure and requests SQL to reduce its memory usage.

Do we need to set Min memory if we have multiple instances?


No, not unless you're overcomitting memory (setting max server memory high enough that all instances cannot reach it given physical memory and what else is running)

Can you please shed some light on this Min memory setting? i.e which scenarios we need to set this?


The only time you really need it is when there's not enough memory on the server for everything running and for all the instances to reach max server memory and hence you want to prevent SQL from reducing its memory to nothing when Windows hits memory pressure. Of course, what's instead going to happen under severe memory pressure is either the OS pages SQL out or the OS crashes due to insufficient memory.

It's also useful in a multi-instance cluster when there's a chance that all instances will end up on one node and that node does not have enough memory for all the instances to reach their configured max server memory. That's usually a temporary situation, so it's there to make the best of what the server has, not for long-term configuration.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1494536
Posted Friday, September 13, 2013 9:51 AM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Wednesday, October 30, 2013 6:42 PM
Points: 667, Visits: 2,055
Thanks for the detailed information Gail.

instance1 is using 1.42GB out of 6GB and instance2 is using 554 MB out of 6GB.

But one thing I did not understand is, 2 the instances never went to their max memory and there are no other application running other then these two instances. 4 GB is left for OS. So where is the memory pressure

But all of sudden after setting Min memory to 1GB, I'm not seeing PLE and CPU issue.

Need to investigate more. I will try setting min memory to zero and see if the problem comes back.

This is 2-node active/passive cluster. 2 instances are on the same node
Post #1494636
Posted Friday, September 13, 2013 10:20 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 2:48 AM
Points: 42,438, Visits: 35,493
They wouldn't have reduced memory usage without a lowmem signal from windows, so if SQL is reducing memory usage, there's something outside of SQL allocating and requesting memory and causing windows to issue low memory signals which in turn cause SQL to reduce its memory usage.


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1494648
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse