[Haskell-cafe] The Garbage Collector Ate My Homework

Stefan O'Rear stefanor at cox.net
Wed Jul 4 02:08:26 EDT 2007


On Wed, Jul 04, 2007 at 03:56:20PM +1000, Thomas Conway wrote:
> Well, not quite, but look at the following:
> 
> 118,342,689,824 bytes allocated in the heap
> 144,831,738,780 bytes copied during GC (scavenged)
> 335,086,064 bytes copied during GC (not scavenged)
> 255,257,516 bytes maximum residency (42 sample(s))
> 
>     222884 collections in generation 0 (3891.90s)
>         42 collections in generation 1 (153.99s)
> 
>        536 Mb total memory in use
> 
>  INIT  time    0.00s  (  0.00s elapsed)
>  MUT   time  233.66s  (776.99s elapsed)
>  GC    time  4045.89s  (4251.52s elapsed)
>  EXIT  time    0.00s  (  0.00s elapsed)
>  Total time  4279.55s  (5028.52s elapsed)
> 
>  %GC time      94.5%  (84.5% elapsed)
> 
>  Alloc rate    506,470,897 bytes per MUT second
> 
>  Productivity   5.5% of total user, 4.6% of total elapsed
> 
> Can anyone offer general suggestions for how to fix this!

The fact that so many collections occured in the nursery suggests that
you are creating a huge amount of temporary objects and immediately
throwing them away.  This is expected if the strictness analyser is
disabled by not enabling optimizations.  Passing -funbox-strict-fields
may help.  Otherwise, as Tim says, your best bet is to post a profile.

Stefan


More information about the Haskell-Cafe mailing list