[Haskell-cafe] Where does memory go?

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Sun Jan 8 12:15:32 EST 2006


On Sun, 2006-01-08 at 17:01 +0000, Joel Reymont wrote:
> I compiled a simple one-liner: main = print "Blah".
> 
> This is the GC report:
> 
>        5,620 bytes allocated in the heap
>            0 bytes copied during GC
> 
>            0 collections in generation 0 (  0.00s)
>            0 collections in generation 1 (  0.00s)
> 
>            1 Mb total memory in use
> 
> Where did the memory go?
> 
> What is 5K and what is (more suprisingly) 1Mb?

At the most coarse level GHC's rts manages memory in 1Mb blocks so the
minimum amount of memory that ghc allocates for it's heap is 1Mb.

That doesn't mean that it uses all of that 1Mb so the VM system may not
need to dedicate the a whole 1Mb of actual RAM. Check with the OS to see
how much of each mapped area is actually resident.

Duncan



More information about the Haskell-Cafe mailing list