> Dear ghc-5.02-linux-i386-unknown,
> 
> I doubt about your -M option work.
> I command (on  32M RAM machine), 
> 
>   ghci +RTS -M16m -RTS
>   ...
>   Prelude> sum [1..333000]
>   GHC's heap exhausted;
>   while trying to allocate 0 bytes in a 19996672-byte heap;
>   use the `-H<size>' option to increase the total heap size.

It looks like you said -M20m, not -M16m.

> The  top  command measures the memory on other linux terminal.
> And it shows  92%  usage of memory in some moment, 
> then, the disk starts to work hardly,
> and only then, `heap exhausted' appears.

Remember that -M<size> only affects the size of the heap.  The GHCi
binary itself is 8M-ish, of which probably 6M is actually paged in.
There is also some malloc'ed memory that isn't counted.

It's not unlikely that your 32M machine will swap when running GHCi with
a 16M heap.  According to top, what is the RSS of the GHCi process?  You
could also try running GHCi with +RTS -Sstderr to get a better idea of
the actual size of the heap.

> Setting -M8m prevents such expansion.
> 
> By the way, there was announced something about changes of meaning
> with  -H, -M ...
> But I had not noticed the change.
> Was it for default values?

The changes are roughly:  -M is now more accurate when using more than 2
generations (i.e. it is now unlikely that we'll use more than the
requested limit, but it's not impossible), and the compacting garbage
collector is automatically engaged when the -M limit is being
approached, in order to try to stay under the limit as long as possible.

Cheers,
        Simon

_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to