Re: Why do we have stack overflows?

2007-05-08 Thread Simon Marlow
Stefan O'Rear wrote: On Thu, May 03, 2007 at 05:36:45PM -0700, Brandon Michael Moore wrote: On Thu, May 03, 2007 at 04:59:58PM -0700, John Meacham wrote: I believe it is because a stack cannot be garbage collected, and must be traversed as roots for every garbage collection. I don't think

Re: Why do we have stack overflows?

2007-05-08 Thread Simon Marlow
Adrian Hey wrote: John Meacham wrote: I believe it is because a stack cannot be garbage collected, and must be traversed as roots for every garbage collection. I don't think there are any issues with a huge stack per se, but it does not play nice with garbage collection so may hurt your

Re: Why do we have stack overflows?

2007-05-08 Thread Adrian Hey
Simon Marlow wrote: I'm more than happy to change the defaults, if there's some agreement on what the defaults should be. The current choice is somewhat historical - we used to have a bound on both heap size and stack size, but the heap size bound was removed because we felt that on balance

Re: Why do we have stack overflows?

2007-05-07 Thread Brian Hulley
Brandon Michael Moore wrote: On Thu, May 03, 2007 at 04:59:58PM -0700, John Meacham wrote: I believe it is because a stack cannot be garbage collected, and must be traversed as roots for every garbage collection. I don't think there are any issues with a huge stack per se, but it does not

Re: Why do we have stack overflows?

2007-05-04 Thread Adrian Hey
John Meacham wrote: I believe it is because a stack cannot be garbage collected, and must be traversed as roots for every garbage collection. I don't think there are any issues with a huge stack per se, but it does not play nice with garbage collection so may hurt your performance and memory

Re: Why do we have stack overflows?

2007-05-04 Thread Malcolm Wallace
Adrian Hey [EMAIL PROTECTED] wrote: Failing because the stack has grown beyond some arbitrary (and typically small) size seems bad to me. Just FYI, nhc98 has a single memory area in which the stack and heap grow towards each other. Memory exhaustion only happens when the stack and heap meet

Re: Why do we have stack overflows?

2007-05-04 Thread Adrian Hey
Malcolm Wallace wrote: Just FYI, nhc98 has a single memory area in which the stack and heap grow towards each other. Memory exhaustion only happens when the stack and heap meet in the middle and GC fails to reclaim any space. However, it can only do this because it is single-threaded. As soon

Why do we have stack overflows?

2007-05-03 Thread Adrian Hey
Hello Folks, Just wondering about this. Please understand I'm not asking why programs use a lot of stack sometimes, but specifically why is using a lot of stack (vs. using a lot of heap) generally regarded as bad. Or at least it seems that way given that ghc run time makes distinction between

Re: Why do we have stack overflows?

2007-05-03 Thread Duncan Coutts
On Thu, 2007-05-03 at 16:24 +0100, Adrian Hey wrote: Hello Folks, Just wondering about this. Please understand I'm not asking why programs use a lot of stack sometimes, but specifically why is using a lot of stack (vs. using a lot of heap) generally regarded as bad. Or at least it seems

Re: Why do we have stack overflows?

2007-05-03 Thread Adrian Hey
Duncan Coutts wrote: On Thu, 2007-05-03 at 16:24 +0100, Adrian Hey wrote: Hello Folks, Just wondering about this. Please understand I'm not asking why programs use a lot of stack sometimes, but specifically why is using a lot of stack (vs. using a lot of heap) generally regarded as bad. Or at

Re: Why do we have stack overflows?

2007-05-03 Thread John Meacham
On Thu, May 03, 2007 at 05:40:24PM +0100, Adrian Hey wrote: Duncan Coutts wrote: On Thu, 2007-05-03 at 16:24 +0100, Adrian Hey wrote: Hello Folks, Just wondering about this. Please understand I'm not asking why programs use a lot of stack sometimes, but specifically why is using a lot of

Re: Why do we have stack overflows?

2007-05-03 Thread Brandon Michael Moore
On Thu, May 03, 2007 at 04:59:58PM -0700, John Meacham wrote: I believe it is because a stack cannot be garbage collected, and must be traversed as roots for every garbage collection. I don't think there are any issues with a huge stack per se, but it does not play nice with garbage collection

Re: Why do we have stack overflows?

2007-05-03 Thread Stefan O'Rear
On Thu, May 03, 2007 at 05:36:45PM -0700, Brandon Michael Moore wrote: On Thu, May 03, 2007 at 04:59:58PM -0700, John Meacham wrote: I believe it is because a stack cannot be garbage collected, and must be traversed as roots for every garbage collection. I don't think there are any issues