468,161 Members | 1,975 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,161 developers. It's quick & easy.

what are the memory caps for threads running as a CLR stored procedure executed by sql server 2005? is it limited by OS only or also by sql servers memory limits? e.g. lets say my clr stored procedure is executed by sql server 2005 then it creates 10

DR
what are the memory caps for threads running as a CLR stored procedure
executed by sql server 2005? is it limited by OS only or also by sql servers
memory limits? e.g. lets say my clr stored procedure is executed by sql
server 2005 then it creates 10 threads and each thread builds a giant array
on the stack, is the limits of each array limited by sql server or the os?
do these clr stored procedures run inside the sql server address space or
does sql server fork a sepperat process for each one?
Oct 25 '07 #1
1 1398
DR,

Your example only holds up if you are using unsafe code. To create an
array on the stack, you have to use unsafe code in C#. Otherwise, you have
a reference on the stack, and the array is created on the heap.

For unsafe code, and for creating new threads, you have to set the
assembly to unsafe in sql server when registering it.

All that aside, SQL Server will manage the memory and the threads. The
CLR is hosted by SQL Server, and defers to SQL Server for threads and
memory, so how those resources are going to be allocated is going to be
dependent on SQL Servers settings (how much memory are you allowing SQL
Server to use? Is it using threads, or fibers? etc, etc).

Basically, SQL Server is the master of it's domain when it comes to the
CLR. The CLR will not do anything that SQL server will not allow it to do.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"DR" <so*******************@yahoo.comwrote in message
news:uw**************@TK2MSFTNGP03.phx.gbl...
what are the memory caps for threads running as a CLR stored procedure
executed by sql server 2005? is it limited by OS only or also by sql
servers memory limits? e.g. lets say my clr stored procedure is executed
by sql server 2005 then it creates 10 threads and each thread builds a
giant array on the stack, is the limits of each array limited by sql
server or the os? do these clr stored procedures run inside the sql server
address space or does sql server fork a sepperat process for each one?

Oct 25 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Franco, Gustavo | last post: by
9 posts views Thread by Microsoft News Server | last post: by
1 post views Thread by Antonio | last post: by
9 posts views Thread by fniles | last post: by
1 post views Thread by gcdp | last post: by
reply views Thread by kamranasdasdas | last post: by
reply views Thread by gcreed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.