[Haskell-cafe] Battling laziness

Joel Reymont joelr1 at gmail.com
Fri Dec 16 07:07:45 EST 2005

-hc points to script#9 below.

script (_, _, affid) (Custom (JoinedTable 0)) =
     do {-# SCC "script#8" #-}push "takeEmptySeat" $
             {-# SCC "script#9" #-}takeEmptySeat Holdem affid []
        {-# SCC "script#10" #-}return $ Eat $ Just Go

What takeEmptySeat does it call pickTable

takeEmptySeat game_type _ filters Go =
     do push "pickTable" $ pickTable game_type filters
        return $ Eat $ Just Go

pickTable retrieves the list of SrvServerInfo structures, etc.

Overall, -hc does not help me figure out where my data is being  
retained. My understanding is that I need to do -hbdrag,void fo  
rthat. I did not try -hd and -hy, they would only help me narrow down  
the producers, right?

My program seems to spend 70% of the time collecting garbage. Notice  
the HUGE overall allocations. This is my trying to launch 4k bots  
over 8 hours. Only 1k bots were launched and just 300 of those got to  
play. Maybe because they did not have time with all the garbage  
collection :-).

The tests that I ran previously did not involve heavy network  
traffic, just a few very small packets. This is why I was able to get  
to thousands of bots in just a couple of hours and keep them there.

./randomplay +RTS -k3k -P -hc -srandomplay.gc
95,739,560,464 bytes allocated in the heap
887,633,330,904 bytes copied during GC
131,849,008 bytes maximum residency (8730 sample(s))

      330325 collections in generation 0 (557.40s)
        8730 collections in generation 1 (16370.05s)

         248 Mb total memory in use

   INIT  time    0.00s  (  0.03s elapsed)
   MUT   time  783.40s  (1872.75s elapsed)
   GC    time  16927.45s  (20075.68s elapsed)
   RP    time    0.00s  (  0.00s elapsed)
   PROF  time  6003.62s  (7058.40s elapsed)
   EXIT  time    0.00s  (  0.00s elapsed)
   Total time  23714.47s  (29006.86s elapsed)

   %GC time      71.4%  (69.2% elapsed) <---- isn't this aweful?

   Alloc rate    122,210,314 bytes per MUT second

   Productivity   3.3% of total user, 2.7% of total elapsed

On Dec 16, 2005, at 11:53 AM, Simon Marlow wrote:

> What does ordinary heap profiling (-hc, -hd, -hy) tell you about  
> what's
> in the heap?  These options should work fine with STM.


More information about the Haskell-Cafe mailing list