Every midnight not a specific time, the sql server will unload the CLR assembly. The reason is that due to memory pressure, the assembly is marked with unload and will be unloaded soon.

How to make the assembly never unloaded, since reload will impact the query performance a lot. Second question is how to find the root cause of sql server reported high memory pressure at midnight?

I was using the performance monitor to track the memory usage of each OS processes, and didn't see the huge memory usage increase at that time.

The system is Windows Server 2008 R2 and SQL server 2008 R2.

The system is x64. Sql server is x64 standard.

The log is "AppDomain 9 ( is marjed for unload due to memory presure.)"

I don't think there is a schedule job at that time.

The reason of why the memory pressure is high at that time is unknown.

  • 1
    Any scheduled jobs at midnight? Jan 3, 2013 at 23:04
  • Can you post the exact message you see / error messages? Can you disclose more information about server configuration? How much RAM, CPU, 32-bit or 64-bit system & what version of windows? Jan 5, 2013 at 6:39

1 Answer 1


SQL server 32 bit instance's virtual memory is limited to 4GB. If you use SQL CLR extensively with a SQL Server 32 bit instance and experience one or more of above errors, Microsoft recommends that you migrate to a 64 bit SQL Server. This will enable SQL CLR to access more virtual memory and may prevent the above errors from happening in your environment.

For futher information check out the following page: http://support.microsoft.com/kb/969962

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.