Assemblies in SQL Server keep unloading and loading again periodically

六月ゝ 毕业季﹏ 提交于 2019-12-01 22:17:45
Solomon Rutzky

The Assemblies are being unloaded due to the exact reason stated in the log: memory pressure. There is nothing specific you can do to prevent that (i.e. no option to disable this behavior). The most you can do is reduce the chances of it happening by adding more memory and/or reducing the memory consumption of your queries and/or SQLCLR objects.

The above suggestions are not meaning that there is anything currently inefficient in either your queries or .NET code, just that if you need more memory, you either need to add more or use less of it. And if you are currently using as little as possible, then you pretty much need to add more memory.

Without seeing your .NET code, it is not possible to determine if there are any areas that could be improved. However, it is more likely that the issue is outside of your SQLCLR code. You need to determine how much memory you have and where it is being used. Try looking through this Question on DBA.StackExchange:

SQL Server 2012 memory consumption outside the buffer pool

Also, SQL Server is not marking the Assembly as UNSAFE. That is simply how you have the Assembly set. You might try altering the Assembly to instead be EXTERNAL_ACCESS if it really is only doing file system access operations.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!