[Haskell-cafe] ghc +RTS -M and -A behaving strange

Daniel Fischer daniel.is.fischer at googlemail.com
Wed Dec 29 13:08:05 CET 2010


On Tuesday 28 December 2010 20:37:50, Johannes Waldmann wrote:
> Hello.
>
> When I run a program compiled with ghc-6.12.3 like this:
>
> ...  +RTS -A2G -M8G -s
>
> I get as an answer:
>
> Heap exhausted;
> Current maximum heap size is 0 bytes (0 MB);
> use `+RTS -M<size>' to increase it.

Overflow, I'm almost sure.
ghci> (8*2^30) `mod` (2^32)
0

>
> and when I put the options
>
> ... +RTS -A2000M -M8000M -s
>
> I get
>
> Heap exhausted;
> Current maximum heap size is 4093640704 bytes (3904 MB);
> use `+RTS -M<size>' to increase it.

ghci> (8000*2^20) `mod` (2^32)
4093640704

Seems GHC uses Word for the allocation figures and you have a 32-bit 
system.

>
> and both numbers look strange.
>
> The behaviour of the program is also strange (instead of "heap
> exhausted" I'd expect it to do some smore garbage collections, which it
> does indeed without the -A option)
>



More information about the Haskell-Cafe mailing list