Re: [Haskell-cafe] Stack overflow in ghci

2007-10-17 Thread Tim Chevalier
On 10/17/07, Maurí­cio [EMAIL PROTECTED] wrote:
 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
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Stack overflow in ghci

2007-10-17 Thread Brent Yorgey
On 10/17/07, Maurí­cio [EMAIL PROTECTED] wrote:

 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
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Stack overflow in ghci

2004-09-02 Thread Ron de Bruijn

--- Tomasz Zielonka [EMAIL PROTECTED]
wrote:

 On Thu, Sep 02, 2004 at 08:47:51AM -0700, Ron de
 Bruijn wrote:
  I heard of the +RTS option. I used:
  ghci SomeModule.hs -someoptions +RTS -K150,
 but
  this doesn't seem to have any effect. 
 
 Try +RTS -K150M.
 -K150 means 150 bytes.
 
 Best regards,
 Tom
 
 -- 
 .signature: Too many levels of symbolic links
 
Ok, it works. I thought the K was equivalent to 1000,
but the first K doesn't have that meaning. Thanks.




__
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe