
Hi, I get this error message when testing a function in ghci: *** Exception: stack overflow I admit I didn't care about efficiency when I wrote that function, but I'm almost sure it is not supposed to eat all my memory. Do I need to say something to ghci if I want it to use all available memory? Thanks, Maurício

On 10/17/07, Maurício
Hi,
I get this error message when testing a function in ghci:
*** Exception: stack overflow
I admit I didn't care about efficiency when I wrote that function, but I'm almost sure it is not supposed to eat all my memory. Do I need to say something to ghci if I want it to use all available memory?
You can start ghci with the -K option to increase the stack size -- ghci +RTS -K256m -RTS for example, sets the maximum stack size to 256 MB. However, stack overflows are usually (though not always) a sign of buggy code, as they're often caused by infinite recursion, and you want to be notified of that sooner rather than later. Cheers, Tim -- Tim Chevalier * catamorphism.org * Often in error, never in doubt "Live fast, love hard, and wear corrective lenses if you need them." --Webb Wilder

On 10/17/07, Maurício
Hi,
I get this error message when testing a function in ghci:
*** Exception: stack overflow
I admit I didn't care about efficiency when I wrote that function, but I'm almost sure it is not supposed to eat all my memory. Do I need to say something to ghci if I want it to use all available memory?
Thanks, Maurício
This can also be caused by some code which is more lazy than necessary, if a huge thunk (= unevaluated expression) is generated which blows the stack when it is evaluated. You may want to read this page: http://haskell.org/haskellwiki/Stack_overflow You should also feel free to send the code causing trouble to this list, and someone can help you figure out what is going on. -Brent
participants (3)
-
Brent Yorgey
-
Maurício
-
Tim Chevalier