Why do we have stack overflows?

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Fri May 4 09:37:43 EDT 2007


Adrian Hey <ahey at iee.org> 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 in the middle and GC fails to reclaim any space.

However, it can only do this because it is single-threaded.  As soon as
you need a separate stack for each thread in a multi-threaded system,
this nice one-dimensional model breaks down.

Regards,
    Malcolm


More information about the Glasgow-haskell-users mailing list