| A Haskell program of mine regularly runs out of stack space, when dumping
| thousands of lines to stdout. Doing a +RTS -H16M -RTS on each execution of
| the program seems to fix it. (Should a program really need this much space,
| though?)

Do you mean "-K16m"?  Or do you mean heap space?

I'm interested in big stacks.  Just occasionally GHC programs will die with
stack overflow, but don't if you make the heap *smaller*!  The reason is that
the garbage collector also does a "stack-squeezing" trick that I have never
written up, so forcing a gc sometimes shrinks the stack massively. I'd be
interested to know if your prog is one of these.

| Is there any way of increasing the amount of stack space available to the
| program at *compile* time, rather than at run-time? I looked for a compiler
| option like -rts-H16M, but couldn't find one. I'm using GHC 0.29.

Seems like a reasonable idea.  But no, GHC doesn't have this mechanism.

Simon

Reply via email to