Setting the hard maximum heap size no longer works
Take this source:
main = do print (product [1..])
Compile it:
$ ghc -O2 A.hs --make -o A -fforce-recomp
[1 of 1] Compiling Main ( A.hs, A.o )
Linking A ...
Set a small maximum heap size, run the program, then kill it after a few seconds:
$ time ./A +RTS -M1M -sstderr
./A +RTS -M1M -sstderr
^C 20,177,576 bytes allocated in the heap
32,352 bytes copied during GC
18,840 bytes maximum residency (1 sample(s))
20,888 bytes maximum slop
682 MB total memory in use (116 MB lost due to fragmentation)
Generation 0: 38 collections, 0 parallel, 0.00s, 0.02s elapsed
Generation 1: 1 collections, 0 parallel, 0.00s, 0.00s elapsed
INIT time 0.00s ( 0.00s elapsed)
MUT time 4.62s ( 5.24s elapsed)
GC time 0.00s ( 0.02s elapsed)
EXIT time 0.00s ( 0.00s elapsed)
Total time 4.62s ( 5.26s elapsed)
%GC time 0.1% (0.4% elapsed)
Alloc rate 4,370,879 bytes per MUT second
Productivity 99.9% of total user, 87.8% of total elapsed
./A +RTS -M1M -sstderr 4.62s user 0.61s system 98% cpu 5.314 total
Far more memory has been allocated in the heap than the 1M max limit.
GHC 6.10.1 on Linux x86_64.
Trac metadata
Trac field | Value |
---|---|
Version | 6.10.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Runtime System |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |