amachanic / sp_whoisactive

sp_whoisactive
GNU General Public License v3.0
1.17k stars 289 forks source link

Added Memory DMV to handle memory requests, and grants #46

Closed mfuller333 closed 3 years ago

mfuller333 commented 3 years ago

I added requested and granted memory from sys.dm_exec_query_memory_grants DMV replacing what was there from sys.sysprocesses. This fundamentally changes how we are counting memory and the DMV we are relying on for our memory counters. Instead of counting pages and calculating our extents to come up with our kb usage; I am just exposing the pre-calculated requested, and granted memory counters measured in kb. This lets us to see exactly who is requesting how much memory, further allowing us to focus on the problem queries causing the Resource Semaphore condition to occur.