[Haskell-cafe] Diagnose stack space overflow

Chris Smith cdsmith at gmail.com
Mon Jul 4 18:09:47 CEST 2011


You can use the heap profiling options in GHC to find out what is using all
the memory.  You'll want to compile with -prof and -rtsopts, and then invoke
the program with +RTS -h<x>, where <x> is one of 'c', 'y', or a few others.
Then run hp2ps on the resulting .hp file to get a graph of what's using all
the memory.

-- 
Chris Smith
On Jul 4, 2011 9:46 AM, "Logo Logo" <saraslogo at gmail.com> wrote:
> Hi,
>
> For the following error:
>
> Stack space overflow: current size 8388608 bytes.
> Use `+RTS -Ksize -RTS' to increase it.
>
> I want to find out the culprit function and rewrite it tail-recursively.
Is
> there a way to find out which function is causing this error other
> than reviewing the code manually?
>
> Thanks,
> Loganathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110704/c1f26ff3/attachment.htm>


More information about the Haskell-Cafe mailing list