I am optimizing a stored procedure in sql server 2005, and while I know of several ways to measure timing differences, I am not quite sure of a good way to measure memory consumption differences.

How do you measure memory consumption of a stored procedure in sql server 2005? My goal is to be able to convince myself something like "it is about the same as it was" or "it uses X times more memory"

  • You are looking for SQL Profiler that tells Reads and Duration – Pankaj Jun 13 '12 at 15:54

You should be using dynamic management view (sys.dm_exec_query_memory_grants or sys.dm_exec_cached_plans ) to investigate memory consumption . Example:-

Select * from sys.dm_exec_cached_plans where objtype='Proc';

I suggest you read Understanding SQL server memory grant article

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy