Stack space overflow after optimization

Ketil Malde ketil+haskell at
Wed Mar 17 19:43:16 EST 2004

Christian Maeder <maeder at> writes:

> Stack space overflow: current size 1048576 bytes.
> Use `+RTS -Ksize' to increase it.
> only when translated with "-O". Is it possible that the next release
> of ghc uses a higher stack size at least when the "-O" flag is set? 
> (Only to reduce the likelyhood that our users need to supply RTS
> flags.)

Also, profiling seems to increase stack usage.  Perhaps the 1M limit
is overly conservative?

> Maybe it is even possible to add a ghc flag that allows to set the
> default Ksize of the generated programs.

> Someone told me to link in an additional header file, but maybe you
> can supply a more convienent solution.

It's fairly simple; you just need to define the approprate constant in
a C file, compile and link it with your program proper.

If I haven't seen further, it is by standing in the footprints of giants

More information about the Glasgow-haskell-users mailing list