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.