Heap size suggestion gets ignored when -G1 flag is passed
Try running any program with
-G1 and a large
-H option -- for example, cichelli from the nofib suite:
$ ./cichelli +RTS -s -H32M -G1 [output snipped] 41,211,752 bytes allocated in the heap 19,329,984 bytes copied during GC 1,760,916 bytes maximum residency (34 sample(s)) 36,724 bytes maximum slop 7 MB total memory in use (0 MB lost due to fragmentation)
Here, the suggestion of 32M seems to have been ignored, as the heap is at most 7M during execution. Whereas without
./cichelli +RTS -s -H32M [output snipped] 41,212,300 bytes allocated in the heap 1,121,304 bytes copied during GC 49,484 bytes maximum residency (1 sample(s)) 36,824 bytes maximum slop 31 MB total memory in use (0 MB lost due to fragmentation)
Here, the size suggestion is used and a 32M heap is allocated.
Shouldn't the GC use the heap size suggestion even when there is only one generation?