Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15694

Memory clerk misleading info?

$
0
0

I am trying to reconcile memory usage on my servers as some of em have memory issues...

Its been 2 days and going through numerous articles including Salvo/bobward, i created below code to see all aspects of memory in one snapshots...

Then collected this data for several other systems have similar configuration and same application running (not on db server)

Discrepancies:

1. Some of the systems shows AWE as ZERO, why?

2. Systems where AWE has values over Zero, (single pages+ Multi pages + virtual committed) values are 1/5th of total memory and less than buffer pages in DB

3. Systems where AWE is non Zero, why single pages are not same value as AWE (AWE represent lock pages in memory but then what single pages represents?)

4. syscache is pretty large on few servers, how to troubleshoot further?

-- awe is disabled on all systems
-- all systems running windows 2008 R2 SP1 X64
-- Lock Pages In Memory is enabled on all systems
-- All data is in MB
declare @dbBufferPages bigint, @total_buffer bigint, @min_server_Mem bigint, @max_server_Mem bigint, @lockedPageAlloc bigint
SELECT @dbBufferPages = COUNT_BIG(*)/128 FROM sys.dm_os_buffer_descriptors
SELECT @total_buffer = cntr_value/128 FROM sys.dm_os_performance_counters WHERE RTRIM([object_name]) LIKE '%Buffer Manager' AND counter_name = 'Total Pages';
select @min_server_Mem=convert(int,value_in_use) from sys.configurations where name in ('min server memory (MB)') 
select @max_server_Mem=convert(int,value_in_use) from sys.configurations where name in ('max server memory (MB)') 
select	@lockedPageAlloc= locked_page_allocations_kb/1024 from sys.dm_os_process_memory
--select convert(int,value_in_use) from sys.configurations where name in ('awe enabled') 

;WITH src AS (select 
		TotMem =  sum(single_pages_kb + multi_pages_kb + virtual_memory_committed_kb) /1024 
		,TotVirMemRes =  sum(virtual_memory_reserved_kb) /1024 
		,TotAWEallocated= SUM(awe_allocated_kb)/1024
		,@lockedPageAlloc as lockedPageAlloc
		,@dbBufferPages as dbBufferPages, @total_buffer as TotBuffer , @min_server_Mem as MinMem , @max_server_Mem as MaxMem
		,SERVERPROPERTY ('ProductVersion') as SQL2008R2
from sys.dm_os_memory_clerks)

select 
	src.*,
	PhysMem = total_physical_memory_kb/(1024) ,
	AvailPhysMem = available_physical_memory_kb/(1024) ,
	SysCache = system_cache_kb/(1024),
	KernelPool=(kernel_paged_pool_kb+kernel_nonpaged_pool_kb)/(1024) ,
	TotVirMem = total_page_file_kb/(1024),
	AvailVirtualMem=available_page_file_kb/(1024)
from sys.dm_os_sys_memory
cross join src


Prakash Heda | Sr Infrastructure DBA | Advent Software | http://www.sqlfeatures.com


Viewing all articles
Browse latest Browse all 15694

Trending Articles