
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? Thanks, Joel -- http://wagerlabs.com/

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

Hello Joel, Sunday, January 08, 2006, 8:01:00 PM, you wrote: JR> I compiled a simple one-liner: main = print "Blah". JR> 5,620 bytes allocated in the heap again, see at the GHC.Handle and so on :) try to find "print" definition and manually substitute all the code generated by this line. btw, one time i seen 15k raised (stripped) exefile just after adding one line of code to Haskell app -- Best regards, Bulat mailto:bulatz@HotPOP.com

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?
Actually I'm surprised it's only 5k. It's more like 30k here. One reason for this allocation is that a buffer gets allocated for the stdout Handle the first time something is written to it. Cheers, Simon
participants (4)
-
Bulat Ziganshin
-
Duncan Coutts
-
Joel Reymont
-
Simon Marlow