You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: BlitzQueries/Perf Counters.sql
+4-4
Original file line number
Diff line number
Diff line change
@@ -26,17 +26,17 @@ select
26
26
frommaster.sys.dm_os_sys_memory
27
27
OPTION (RECOMPILE);
28
28
29
-
30
-
--Total amount of RAM consumed by database data (Buffer Pool). This should be the highest usage of Memory on the server.
31
-
Select SQLBufferPoolUsedMemoryMB = (SelectSUM(single_pages_kb+multi_pages_kb)/1024AS [SPA Mem, Mb] FROMsys.dm_os_memory_clerks WITH (NOLOCK) Where type ='MEMORYCLERK_SQLBUFFERPOOL')
29
+
--Total amount of RAM consumed by database data (Buffer Pool). This should be the highest usage of Memory on the server.
30
+
Select SQLBufferPoolUsedMemoryMB = (SelectSUM(pages_kb)/1024AS [SPA Mem, Mb] FROMsys.dm_os_memory_clerks WITH (NOLOCK) Where type ='MEMORYCLERK_SQLBUFFERPOOL')
32
31
--Total amount of RAM used by SQL Server memory clerks (includes Buffer Pool)
33
-
, SQLAllMemoryClerksUsedMemoryMB = (SelectSUM(single_pages_kb+multi_pages_kb)/1024AS [SPA Mem, Mb] FROMsys.dm_os_memory_clerks WITH (NOLOCK))
32
+
, SQLAllMemoryClerksUsedMemoryMB = (SelectSUM(pages_kb)/1024AS [SPA Mem, Mb] FROMsys.dm_os_memory_clerks WITH (NOLOCK))
34
33
--How long in seconds since data was removed from the Buffer Pool, to be replaced with data from disk. (Key indicator of memory pressure when below 300 consistently)
35
34
,[PageLifeExpectancy] = (SELECT cntr_value FROMsys.dm_os_performance_counters WITH (NOLOCK) WHERE [object_name] LIKE N'%Buffer Manager%'AND counter_name = N'Page life expectancy' )
36
35
--How many memory operations are Pending (should always be 0, anything above 0 for extended periods of time is a very high sign of memory pressure)
37
36
,[MemoryGrantsPending] = (SELECT cntr_value FROMsys.dm_os_performance_counters WITH (NOLOCK) WHERE [object_name] LIKE N'%Memory Manager%'AND counter_name = N'Memory Grants Pending' )
38
37
--How many memory operations are Outstanding (should always be 0, anything above 0 for extended periods of time is a very high sign of memory pressure)
39
38
,[MemoryGrantsOutstanding] = (SELECT cntr_value FROMsys.dm_os_performance_counters WITH (NOLOCK) WHERE [object_name] LIKE N'%Memory Manager%'AND counter_name = N'Memory Grants Outstanding' );
WHERE (ISNULL(r.blocking_session_id,0) =0OR ISNULL(r.blocking_session_id,0) =r.session_id)
56
+
AND EXISTS (SELECT*FROM#SysProcesses AS R2 WHERE R2.collection_time = r.collection_time AND ISNULL(R2.blocking_session_id,0) = r.session_id AND ISNULL(R2.blocking_session_id,0) <> R2.session_id)
0 commit comments