Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / General / Security / August 2007

Tip: Looking for answers? Try searching our database.

in sql server is it possible to get the amount of memory used by a stored procedure? e.g. memory usage statistics per stored procedure?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Daniel - 28 Aug 2007 00:26 GMT
in sql server is it possible to get the amount of memory used by a stored
procedure? e.g. memory usage statistics per stored procedure?
Uri Dimant - 28 Aug 2007 06:27 GMT
Daniel
See if this helps you

SELECT TOP 25
obj.[name],
i.[name],
i.[type_desc],
count(*)AS Buffered_Page_Count ,
count(*) * 8192 / (1024 * 1024) as Buffer_MB
   -- ,obj.name ,obj.index_id, i.[name]
FROM sys.dm_os_buffer_descriptors AS bd
   INNER JOIN
   (
       SELECT object_name(object_id) AS name
           ,index_id ,allocation_unit_id, object_id
       FROM sys.allocation_units AS au
           INNER JOIN sys.partitions AS p
               ON au.container_id = p.hobt_id
                   AND (au.type = 1 OR au.type = 3)
       UNION ALL
       SELECT object_name(object_id) AS name
           ,index_id, allocation_unit_id, object_id
       FROM sys.allocation_units AS au
           INNER JOIN sys.partitions AS p
               ON au.container_id = p.hobt_id
                   AND au.type = 2
   ) AS obj
       ON bd.allocation_unit_id = obj.allocation_unit_id
LEFT JOIN sys.indexes i on i.object_id = obj.object_id AND i.index_id =
obj.index_id
WHERE database_id = db_id()
GROUP BY obj.name, obj.index_id , i.[name],i.[type_desc]
ORDER BY Buffered_Page_Count DESC

> in sql server is it possible to get the amount of memory used by a stored
> procedure? e.g. memory usage statistics per stored procedure?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.