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
时间: 2024-10-28 20:15:45