Tuesday, May 21, 2013

Memory, Memory and Memory

It’s not been long when I was troubleshooting sql server memory related performance issue and it came back again for another environment

I thought why not write it down something about memory, which can help you and me remember clearly about memory related troubleshooting :) :)
 To easily understand this, I am trying to put notes in bullet points.
First two important questions you should ask yourself are:

·        Is this external memory pressure? In simple terms is it Physical RAM A.KA. Windows OS memory pressure?
·        Is this internal memory pressure a.k.a pressure on VAS allocated to SQL Server by windows OS?
Two answer this, it is important to determine where the pressure is coming from?
Next question comes:
·        How quickly I can determine that? and using what tool?
 Answer is using sys.dm_os_ring_buffers:)
 ·        What exactly this DMO is?
This DMO tells us about if any alerts are fired or recorded within the system
If you select result set from this DMO, you will get lot of ring buffers. The one and only which can point to memory pressure is called "RING_BUFFER_RESOURCE_MONITOR"
If you look at the xml record for RING_BUFFER_RESOURCE_MONITOR, keep an eye on node called "<Notification>"
This node will give you insight on the reason for low memory pressure.
 So before we start looking at performance counters like buffer cache hit ratio, page life expectancy, target server memory etc etc, why not query sys.dm_os_ring_buffers and see what it has to tell about any recording of memory!