Why do we have stack overflows?
Duncan Coutts
duncan.coutts at worc.ox.ac.uk
Thu May 3 11:39:28 EDT 2007
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 that way given that ghc run time
> makes distinction between the two and sets separate
> limits for them (default max stack size being relatively small
> whereas default max heap size in unlimited). So programs can
> fail with a stack overflow despite having bucket loads of heap
> available?
Perhaps it's there to help people who write simple non-terminating
recursion. They'll get an error message fairly soon rather than using
all memory on the machine and invoking the wrath of the OOM killer.
Duncan
More information about the Glasgow-haskell-users
mailing list