码迷,mamicode.com
首页 > 数据库 > 详细

Clerk:MEMORYCLERK_SQLCLR

时间:2016-06-03 17:11:57      阅读:408      评论:0      收藏:0      [点我收藏+]

标签:

MEMORYCLERK_SQLCLR 消耗的memory很高,如下图
技术分享

查看CLR消耗的内存总计

SELECT SUM(domc.pages_kb) AS [TotalPagesKb],
       SUM(domc.virtual_memory_committed_kb) AS [TotalVirtualMemory_Committed_Kb]
FROM   sys.dm_os_memory_clerks domc
WHERE  domc.[type] LIKE %CLR%AND    domc.[memory_node_id] <> 64;

技术分享

如何控制CLR的内存消耗?

 

Appendix 由于查询内存消耗的脚本

select top 11 
    mc.type,mc.name,
    sum(mc.pages_kb) as AllocatedPages_KB,
    sum(mc.virtual_memory_reserved_kb) as VM_Reserved_KB,
    sum(mc.virtual_memory_committed_kb) as VM_Committed_KB,
    --sum(mc.shared_memory_reserved_kb) as ShareMem_Reserved_KB,
    --sum(mc.shared_memory_committed_kb) as ShareMem_Committed_KB,
    max(mc.page_size_in_bytes)/1024 as SinglePageSize_KB
from sys.dm_os_memory_clerks mc
group by mc.type,mc.name
order by AllocatedPages_KB desc,mc.type,mc.name;


SELECT top 111 object_name, counter_name, instance_name, cntr_value, cntr_type
FROM sys.dm_os_performance_counters
where counter_name like N%clr%
order by cntr_value desc 

 

Clerk:MEMORYCLERK_SQLCLR

标签:

原文地址:http://www.cnblogs.com/ljhdo/p/5556878.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!