We have been running into an issue where we get this error message when we try to alter a clr assembly in SQL Server:
Failed to initialize Common Language Runntime (CLR) due to memory pressure.
This is probably due to memory pressure in the MemToLeave Region of memory.
Error 6513
I found information about looking at how much memory the CLR is allowed to use, etc and I came across this query.
Query:
select
single_pages_kb + multi_pages_kb + virtual_memory_committed_kb
from sys.dm_os_memory_clerks where type = 'MEMORYCLERK_SQLCLR'
When I run it I get this:
11676 kb or about 11MB
Does that mean that the CLR is only allowed to use 11MB of MemToLeave Memory?
Thanks,
S
MS Support KB:
Possible causes of “Failed to initialize the Common Language Runtime (CLR)” when using SQL CLR
Has a link to Various memory errors are logged to SQL Server error log when using SQL CLR objects
… Which has some suggestions for both SQL Server 2005 and 2008