Version française
Home     About     Download     Resources     Contact us    
Browse thread
Optimizing garbage collection
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Mauricio Fernandez <mfp@a...>
Subject: Re: [Caml-list] Optimizing garbage collection
On Mon, Nov 22, 2010 at 04:10:49PM +0100, Damien Doligez wrote:
> On 2010-11-21, at 20:26, Eray Ozkural wrote:
> 
> > I've been thinking whether some kind of doubling strategy would work for the minor heap size. What do you think?
> 
> Sounds like an interesting idea, but what heuristic would you use?
> When everything is smooth, the running time decreases something like
> exponentially with the minor heap size, so you'd always want to
> increase the size.  How do you tell when to stop?  And then, if the
> program is not behaving uniformly, when do you decide to reduce
> the size?

Just dropping an idea, not sure it's worth a dime...
How about an exponential growth scheme with hysteresis?
On each minor collection, multiply the size by a if the rate of promoted words
exceeds r1, divide by b if the rate is below r2 (r1 > r2); otherwise remain
stable.

In order to account for the effect of the cache hierarchy, r1 and r2 could
also be a function of the current heap size (e.g., with r1 and r2 being higher
when approaching "magic" numbers such as the size of the L2 cache on the left
and right side respectively).

It'd also be very nice to be able to estimate the amount of time spent on
minor + major GC collection vs. the mutator.

-- 
Mauricio Fernandez  -   http://eigenclass.org