[GHC] #5259: Heap used by compacting collector larger than heap used without.
GHC
cvs-ghc at haskell.org
Wed Jun 15 17:39:32 CEST 2011
#5259: Heap used by compacting collector larger than heap used without.
-----------------------+----------------------------------------------------
Reporter: r6 | Owner:
Type: bug | Status: new
Priority: normal | Component: Runtime System
Version: 6.12.3 | Keywords:
Testcase: | Blockedby:
Os: Linux | Blocking:
Architecture: x86 | Failure: None/Unknown
-----------------------+----------------------------------------------------
Comment(by r6):
Here is a small example program:
{{{
module Main where
import qualified Data.ByteString as BS
l = map (BS.replicate (1024^2 `div` 2)) [0..]
main = do
print (map BS.head l)
print (map BS.head l)
}}}
For me, ghc --make -O2 Alloc.hs && ./Alloc +RTS -M100M -c -S
runs until the heap is exhasted and outputs:
{{{
Heap exhausted;
Current maximum heap size is 104857600 bytes (100 MB);
104,220,800 bytes allocated in the heap
198 MB total memory in use (98 MB lost due to fragmentation)
}}}
On the other hand, ghc --make -O2 Alloc.hs && ./Alloc +RTS -M100M -S
runs until the heap is exhasted and outputs:
{{{
Heap exhausted;
Current maximum heap size is 104857600 bytes (100 MB);
52,397,636 bytes allocated in the heap
100 MB total memory in use (49 MB lost due to fragmentation)
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5259#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list