question

AbhishekKulkarni-7897 avatar image
0 Votes"
AbhishekKulkarni-7897 asked Cathyji-msft edited

SQL 2008 Replication Error - Failed to initialize the Common Language Runtime

Hi,

We have quite a few Tables included in our Replication setup from SQL2008 to SQL2014. All running Good. While for maintenance a few were dropped and were to be recreated as new Publications. We do this all the time. This is an Axapta Application.

The issue we see is now while creating these few new Publications we get below error- I have tried to enable CLR, increased the allocated memory to SQL instance - but no luck.

Message: Failed to initialize the Common Language Runtime (CLR) v2.0.50727 due to memory pressure. This is probably due to memory pressure in the MemToLeave region of memory. For more information, see the CLR integration documentation in SQL Server Books Online.

Failed to initialize the Common Language Runtime (CLR) v2.0.50727 due to memory pressure. This is probably due to memory pressure in the MemToLeave region of memory. For more information, see the CLR integration documentation in SQL Server Books Online. 

Would really appreciate if any one can help to resolve this and setup the replication.

sql-server-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

BjoernPeters avatar image
0 Votes"
BjoernPeters answered BjoernPeters commented

It is hard to say what might help you...

if I google for that error, I'll find many "easy" solutions or troubleshooting guides for that error, and we don't know which of them you already tried...

So as the error message states... it has something to do with (not enough) memory... so you have to (somehow) get more available memory for that CLR.

Please explain what you mean by "..., increased the allocated memory to SQL instance..."

Does it mean adding more memory to that server, configuring min/max memory of that SQL instance, or changing os memory configuration (vas?)

And maybe you'll find a hint in the eventvwr for more details...
Or you can get hints from your last activities on that server... what has changed between your last recreation and now?
Did someone install a new patch, or changed something in the configuration, added a new .NET version... something like that.

Please, give us more information on your system.

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks Bjoern, I got some Pointers from your answer. I will check with Network team about new patches that affected the .Net Framework. And also check event viewer.

Nothing has changed on the server. As a routine maintenance/ promotion of the application, we dropped few publications. Dev team worked on their side and I went ahead to add the publications. We do it every now and then.
Increased the configuration on SQL instance to use more memory.
I would like to give as much memory to CLR but I do not see an easy way to give it. I have 256 GB on that Server and 90% allocated to SQL.

0 Votes 0 ·

Thanks much. Have already done extensive troubleshooting and tried to get maximum help from internet,

The article in above link gives info and my amount available is quite huge.

0 Votes 0 ·
Show more comments
Cathyji-msft avatar image
0 Votes"
Cathyji-msft answered Cathyji-msft edited

Hi @AbhishekKulkarni-7897,

This is generally caused if using 32bit SQL Server. SQL server 32 bit instance's virtual memory is limited to only 4GB. You can check the bit by running 'select @@version'.


If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks Cathyji. Its a 64 bit instance. That is what bothering me. in 64 bit SQL there is no "MemToLeave". ( per MS Docs) so Not sure what is causing this.

0 Votes 0 ·
Cathyji-msft avatar image Cathyji-msft AbhishekKulkarni-7897 ·

Hi @AbhishekKulkarni-7897,

Did you find any other useful error message from SQL server error log? Could you share us the result of select @@version query on publisher and subscriber instance?

0 Votes 0 ·