[Haskell-cafe] Re: How to increment an Int in Haskell (stack overflow issue)

John Lato jwlato at gmail.com
Wed Mar 25 19:06:31 EDT 2009


> From: Tim Bauer <bauertim at eecs.orst.edu>
>
> I have a program that is currently blowing out the stack,
>    Stack space overflow: current size 8388608 bytes.
>    Use `+RTS -Ksize' to increase it.
> I am pretty sure I get to the end of the computation that
> increments various statistic counters (lazily?) and only
> when I go to print them out at the end, do things fail.
>

In addition to the excellent advice provided by others on this topic,
you may want to look at using GHC's heap profiler if you can't track
down the source of a memory issue.  I've found it helpful in the past.
 Keep in mind that there are several different modes that may or may
not be helpful for a particular problem, so you should try them all to
see if you get any useful information.

John


More information about the Haskell-Cafe mailing list