Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
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
Author
Message
Posted Thursday, April 4, 2013 10:49 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Friday, September 26, 2014 5:53 AM
Points: 437, Visits: 321
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?

TIA,

Chris
Post #1438905
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse