Find Memory Usage of Executing Procedures

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]

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

Onwuzuruike 29 Aug 2015 at 8:11 am

This is with reference to MCQ NO.9,here ramuneretion of Rs2000p.a. is provided for even in year of loss which conflicts with the assumption that in absence of agreement salary is payable only in year of profit?

praful 06 Sep 2011 at 1:51 am

my stored proecedure run 4 min off peak time and 30 mins in peak time, i am not able to find the cause for 30 mins duration.Please tell me the various ways to find the bottleneck cause solution.
we has transaction replication setup on the same server.

Featured Articles

 Site Author

  • Thanks for visiting!