Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Making an AppDomain containing SQL CLR Assembly persist in memory Expand / Collapse
Posted Thursday, April 4, 2013 10:49 AM


Group: General Forum Members
Last Login: Wednesday, October 22, 2014 3:03 AM
Points: 437, Visits: 325
Hi There,

I hope this is in the right board, the SQL CLR section seems to be under SQL Server 2005.

I have a CLR Assembly that contains methods to encrypt and decrypt a table of fields using AES.

We see a large performance hit on the first run of these methods whilst the CLR is loaded into memory. This takes between 15 and 20 seconds. Subsequent calls take < 1 second until the Assembly is unloaded.

I have done some reading around AppDomains and it seems that the AppDomain is held in memory 'to improve performance' until such time as SQL Server deems that 'memory pressure' requires it to be unloaded.

We will be hitting these methods quite often but not consistently enough to prevent the CLR from unloading.

Is there anyway to adjust the server settings or assembly options to make them more persistent?


Post #1438905
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse