how out of memory is handled in Haskell

Hi. Here: http://damienkatz.net/2008/03/what_sucks_abou.html I found how Erlang (or at least old versions of Erlang) handles out of memory failure: it just calls exit(1). How is this handled in GHC? - exit(1)? - abort()? - IO exception? Thanks Manlio Perillo

manlio_perillo:
Hi.
Here: http://damienkatz.net/2008/03/what_sucks_abou.html
I found how Erlang (or at least old versions of Erlang) handles out of memory failure: it just calls exit(1).
How is this handled in GHC? - exit(1)? - abort()? - IO exception?
GHC:
$ ./A +RTS -M2M
Heap exhausted;
Current maximum heap size is 1998848 bytes (1 MB);
use `+RTS -M<size>' to increase it
Which is invoked via the OutOfHeapHook function:
#include "Rts.h"
#include

Manlio Perillo ha scritto:
[...]
How is this handled in GHC? - exit(1)? - abort()? - IO exception?
Ok, found it by myself: http://hackage.haskell.org/trac/ghc/ticket/1791 It is also explicitly documented in: http://haskell.org/ghc/docs/latest/html/libraries/base/Control-Exception.htm... and it's very strange that I have not seen it, sorry. Manlio Perillo
participants (2)
-
Don Stewart
-
Manlio Perillo