Find Memory Usage of Executing Procedures
-
Posted on June 17, 2009 by Derek Dieter
-
1
To get the query memory usage of currently executing queries run the following:
[cc lang=”sql”]
SELECT
TEXT
,query_plan
,requested_memory_kb
,granted_memory_kb
,used_memory_kb
FROM sys.dm_exec_query_memory_grants emg
CROSS APPLY sys.dm_exec_sql_text(sql_handle)
CROSS APPLY sys.dm_exec_query_plan(emg.plan_handle)
ORDER BY emg.requested_memory_kb DESC
[/cc]
Post a comment
- Comments (RSS)
- Trackback
- Permalink
3 comments
leonardustono
16 Jul 2013 at 7:59 am
Dear Derek,
i have tried this query in my sql server. i executed ad hoc query “select * …” , in same server where i ran this DMV . but i didn’t see that “select *… ” on this DMV result ..
i want to know memory consume of “select * … ”
can you help me to solve this issue ?
thank you,
best regards,
Leo