Asked By Willy Denoyette [MVP]
29-Oct-07 04:57 PM
I'm not clear on what you mean with shared memory, are you talking about
memory mapped files, or something else?. I'm also not clear on what you are
trying to achieve here.
To answer the remainder of your question, whenever you call into a managed
function or SP for the first time, the host (SQL Server) loads the CLR which
at his turn creates an Application Domain (AD) and loads your registered
assembly into that AD. The CLR keeps this AD loaded, and with it, the loaded
assemblies, until something really bad happens or until the DB is taken
off-line. The SQL/CLR can reload the AD whenever something bad happens in
your code, but otherwise the assemblies stay loaded until the server stops
or until the DB gets detached. That means that once you have called into a
function/sp your (Jitted) code remains loaded in the SQL Server process
space.
Willy.