views:

389

answers:

3

Here's the thing. We've been chansing an bug on my WCF web application (W2K3 IIS) which was resulting in a stackoverflow. To fix it I need to increase the stack of my application by creating a thread with the amount of memory I want to allocate.
But what happens with the child threads? My app creates many threads, will they inherit the value or I'll have to set every single thread with the new value?

Edit: If I run the (WCF) services as a console host they work just fine. Also, If I modify the stack of the w3wp.exe (with the EDITBIN) they also work fine on IIS.
So I need to increase the stack.I know I can create a thread with the stack size (is there another way?) but I need to know what happens with the child threads.

Edit2: We need to define some BIG vectors which are resulting in a stack overflow. So it is not a bug in our system. I really need (have) to increase the stack

+1  A: 

It sounds like you need to think more carefully about why you're getting a stack overflow instead of merely allocating more memory.

Is there some function with a huge amount of local variables or an array that is going on the stack?

Are you sure you aren't leaking somewhere with inadvertent recursive loops?

Adam Davis
yes I am... I just need to know what happens with the child threads
sebastian
+1  A: 

After trying it myself I can say yes! Child threads keep the amount of stack set on the parent thread.

sebastian
A: 

This info help you alot

lsalamon
Thanks... DebugDiag helped me realize where the problem was
sebastian