SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL Buffer Manager Size


SQL Buffer Manager Size

Author
Message
SQLSACT
SQLSACT
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2148 Visits: 2931
Hi Guys

I use the following script to assess the current size used by my plan cache and the data cache

select object_name,counter_name,cntr_value,cntr_value*8/1024 MBs from sys.dm_os_performance_counters
where object_name like '%Plan Cache%' and counter_name like '%Cache Pages%' and instance_name like '%_Total%'
or object_name like '%Buffer Manager%' and counter_name like '%Database Pages%'



Regarding the plan cache pages, considering that when a plan that exceeds 8KB is allocated outside of the buffer pool by the multipage allocator. Does this query include that or is this just what's in my buffer pool?

Any Help?

Thanks
hs24
hs24
SSC Eights!
SSC Eights! (880 reputation)SSC Eights! (880 reputation)SSC Eights! (880 reputation)SSC Eights! (880 reputation)SSC Eights! (880 reputation)SSC Eights! (880 reputation)SSC Eights! (880 reputation)SSC Eights! (880 reputation)

Group: General Forum Members
Points: 880 Visits: 374
you need to look in sys.dm_os_memory_clerks using a query such as

SELECT SUM(multi_pages_kb)
FROM sys.dm_os_memory_clerks
SQLSACT
SQLSACT
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2148 Visits: 2931
Ok

I've verified that the performance counter includes memory for plans allocated through both MPA and SPA by using the below

SELECT  [type]
, SUM(single_pages_kb)/1024 AS [SPA Mem, Kb]
, SUM(multi_pages_kb)/1024 AS [MPA Mem, Kb]
, SUM(single_pages_kb)/1024+ SUM(multi_pages_kb)/1024 Total
FROM sys.dm_os_memory_clerks
where type in ('CACHESTORE_SQLCP','CACHESTORE_OBJCP','CACHESTORE_PHDR')
GROUP BY [type] with rollup
ORDER BY SUM(single_pages_kb)

select object_name,counter_name,cntr_value*8/1024 MBs from sys.dm_os_performance_counters
where object_name like '%Plan Cache%' and counter_name like '%Cache Pages%' and instance_name like '%_Total%'



That's all good and well.

However, I am assuming that the DMV sys.dm_exec_cached_plans reports on all plans, irrespective of whether they were allocated using SPA or MPA

The problem is, why do the below queries return 2 different results?

SELECT 
sum(cast(size_in_bytes as decimal(18,2)))/1024/1024 AS [Total MBs]
FROM sys.dm_exec_cached_plans

SELECT
SUM(single_pages_kb)/1024+ SUM(multi_pages_kb)/1024 [Total MBs]
FROM sys.dm_os_memory_clerks
where type in ('CACHESTORE_SQLCP','CACHESTORE_OBJCP','CACHESTORE_PHDR')



Any help with this guys?

Thanks
SQLSACT
SQLSACT
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2148 Visits: 2931
Guys

Any help/ideas with this? Or pointers in the right direction?

Thanks
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search