我的SQL Server进程内存使用情况在64位计算机上显示超过3 GB。
我试图用
找到问题SELECT
[object_name], [counter_name],
[instance_name], [cntr_value]
FROM sys.[dm_os_performance_counters]
WHERE [object_name] = 'SQLServer:Buffer Manager'
结果是:
Buffer cache hit ratio 6368
Buffer cache hit ratio base 6376
Page lookups/sec 438640376
Free list stalls/sec 182
Free pages 215468
Total pages 442368
Target pages 442368
Database pages 196000
Reserved pages 0
Stolen pages 30900
Lazy writes/sec 1510
Readahead pages/sec 1204816
Page reads/sec 1384292
Page writes/sec 765586
Checkpoint pages/sec 129207
AWE lookup maps/sec 0
AWE stolen maps/sec 0
AWE write maps/sec 0
AWE unmap calls/sec 0
AWE unmap pages/sec 0
Page life expectancy 119777
由于这似乎是太多的页面查找,所以我执行了这个查询
SELECT 1.0*cntr_value /
(SELECT 1.0*cntr_value
FROM sys.dm_os_performance_counters
WHERE counter_name = 'Batch Requests/sec')
AS [PageLookupPct]
FROM sys.dm_os_performance_counters
WHERE counter_name = 'Page lookups/sec'
此查询的结果超过350。
尝试了另一个指标
SELECT (1.0*cntr_value/128) /
(SELECT 1.0*cntr_value
FROM sys.dm_os_performance_counters
WHERE object_name like '%Buffer Manager%'
AND lower(counter_name) = 'Page life expectancy')
AS [BufferPoolRate]
FROM sys.dm_os_performance_counters
WHERE object_name like '%Buffer Manager%'
AND counter_name = 'total pages'
结果是0.029。
我是从Tim Ford blogs中选择的。
内存使用的可能原因是什么?这是不好的查询计划还是应该查看其他一些区域?
[更新]
MEMORYCLERK_SQLBUFFERPOOL
正在使用3573824(VM保留)3573824(已提交VM)
答案 0 :(得分:0)
检查属性\内存\最大服务器内存下的设置。
请参阅这篇文章的答案:Seeing High Memory Usage In SQL Server 2012,其中概括了(大致)SQL Server将根据最大可用内存声明它的内容。除非您需要其他内存,否则不要担心。