Behavior of the -H RTS option, possible doc/impl mismatch

Akio Takano tkn.akio at
Wed Feb 16 09:24:31 CET 2011


I have questions regarding to the -H RTS option. I use GHC 7.0.1 on
Linux x86-64.

The User's Guide says:

-Hsize  [Default: 0] This option provides a “suggested heap size” for
the garbage collector. The garbage collector will use about this much
memory until the program residency grows and the heap size needs to be
expanded to retain reasonable performance.

However the actual behavior seems to be quite different. As an
example, for a particular program:

./a.out +RTS -N7 -A256M -H2G uses around 7 GBytes of memory
./a.out +RTS -N7 -A256M -H6G uses around 13 GBytes of memory

If the User's Guide is correct, changing -H2G to -H6G should not
increase the heap usage beyond 6 GBytes.

In the rts source, I see the parameter value
(RtsFlags.GcFlags.heapSizeSuggestion) is used only to adjust the size
of the allocation areas, not the entire heap.

How is the -H option supposed to behave? How does it behave currently?

Takano Akio

More information about the Glasgow-haskell-users mailing list