SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Query Memory Grants - Max Used


Query Memory Grants - Max Used

Author
Message
SQLSACT
SQLSACT
SSCoach
SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)

Group: General Forum Members
Points: 19971 Visits: 3123
Hi All
I've noticed a sudden drop in PLE on my SQL Server.
It's not to say that the system is now slow, just a noticed a drop and everything still seems to be chugging along nicely.

Anyway, in trying to find the cause of this drop, I looked at sys.dm_exec_query_memory_grants and noticed the following....



What's interesting is that for most of that result set, the used and max used amounts are significantly lower than the granted memory amounts.
This is not normal behavior for this particular system
Could this be playing a part in my PLE drop?
As far as the cause for this differences between the granted and the used memory, I'm leaning towards the cause being that SQL Server is over estimating the memory requirements for the query. Am I on track here?
Could this be attributed to bad parameter sniffing? How can I track this down?

Thanks
Sue_H
Sue_H
SSC Guru
SSC Guru (77K reputation)SSC Guru (77K reputation)SSC Guru (77K reputation)SSC Guru (77K reputation)SSC Guru (77K reputation)SSC Guru (77K reputation)SSC Guru (77K reputation)SSC Guru (77K reputation)

Group: General Forum Members
Points: 77709 Visits: 15545
SQLSACT - Thursday, March 1, 2018 3:59 AM
Hi All
I've noticed a sudden drop in PLE on my SQL Server.
It's not to say that the system is now slow, just a noticed a drop and everything still seems to be chugging along nicely.

Anyway, in trying to find the cause of this drop, I looked at sys.dm_exec_query_memory_grants and noticed the following....



What's interesting is that for most of that result set, the used and max used amounts are significantly lower than the granted memory amounts.
This is not normal behavior for this particular system
Could this be playing a part in my PLE drop?
As far as the cause for this differences between the granted and the used memory, I'm leaning towards the cause being that SQL Server is over estimating the memory requirements for the query. Am I on track here?
Could this be attributed to bad parameter sniffing? How can I track this down?

Thanks


When you query dm_exec_query_memory_grant, it's showing what the grants are at that moment in time. It has no historical information. I'd worry more if you see a lot of rows with null values, meaning the sessions are waiting for memory.
Drops in PLE can be perfectly normal at times. You can see with running dbcc checkdb, if you execute right after the buffer pool has been swept by the lazy writer, etc. If it drops and then goes back up near it's normal baseline, it is often nothing to worry about.
Queries that have a lot of pages and missing indexes can hurt as can those that do a lot of physical reads. Jonathan Kehayias has a great query in this post that can help with information on both:
Sudden drop in Page Life Expectancy

Sue




Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum









































































































































































SQLServerCentral


Search