sebagomez
sebagomez

Reputation: 9609

IIS stackoverflow

We've been chasing an bug on my WCF web application (W2K3 IIS) which was resulting in a stackoverflow.

To fix it I needed to increase the stack of my application by creating a thread with the amount of memory I wanted to allocate.

But what happens with the child threads? My app creates many threads, will they inherit the value or will I 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

Upvotes: 2

Views: 1533

Answers (2)

sebagomez
sebagomez

Reputation: 9609

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

Upvotes: 2

Adam Davis
Adam Davis

Reputation: 93605

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

Upvotes: 1

Related Questions