• Grant Fritchey (10/5/2013)


    I would suggest focusing first on wait stats to understand what is causing the server to run slow. But, if you want to know if you're out of memory, going after messages in the system through the ring buffers is the best way. You can run queries against sys.dm_os_ring_buffers to determine if you're getting out of memory messages. I wrote about it in an article on SimpleTalk[/url].

    Thanks, using that ring buffer script combined with the one below, if I see shrink notifications from the second script, that would narrow my search down as to what was out of memory, correct?

    SET QUOTED_IDENTIFIER ON

    SELECT

    EventTime,

    n.value('(Pool)[1]', 'int') AS [Pool],

    n.value('(Broker)[1]', 'varchar(40)') AS [Broker],

    n.value('(Notification)[1]', 'varchar(40)') AS [Notification],

    n.value('(MemoryRatio)[1]', 'int') AS [MemoryRatio],

    n.value('(NewTarget)[1]', 'int') AS [NewTarget],

    n.value('(Overall)[1]', 'int') AS [Overall],

    n.value('(Rate)[1]', 'int') AS [Rate],

    n.value('(CurrentlyPredicted)[1]', 'int') AS [CurrentlyPredicted],

    n.value('(CurrentlyAllocated)[1]', 'int') AS [CurrentlyAllocated]

    FROM (

    SELECT

    DATEADD (ss, (-1 * ((cpu_ticks / CONVERT (float, ( cpu_ticks / ms_ticks ))) - [timestamp])/1000), GETDATE()) AS EventTime,

    CONVERT (xml, record) AS record

    FROM sys.dm_os_ring_buffers

    CROSS JOIN sys.dm_os_sys_info

    WHERE ring_buffer_type = 'RING_BUFFER_MEMORY_BROKER') AS t

    CROSS APPLY record.nodes('/Record/MemoryBroker') AS x(n)

    ORDER BY EventTime DESC;