Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
caml_oldify_local_roots takes 50% of the total runtime
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-10-27 (13:17)
From: Brian Hurt <bhurt@j...>
Subject: Re: [Caml-list] caml_oldify_local_roots takes 50% of the total runtime
Hendrik Tews wrote:

>Gerd Stolpmann <> writes:
>   Global roots are for pointers that are outside the heap for a long time.
>   I think these could be handled more efficiently by the GC, e.g. by
>   moving global roots to a second list when the object referenced by the
>   pointer is moved to the major heap.
>I destilled this thread into two feature wishs: 4145, 4146.
>Caml-list mailing list. Subscription management:
>Beginner's list:
>Bug reports:
With respect to 4146 (minor heap size adjusts to memory size)- I'm not 
sure this is a good idea.  32K is small enough to fit into L1 cache with 
space left over on pretty much all systems these days (64K L1 cache 
seems to be standard).  Having the minor heap small enough to fit into 
L1 cache, and thus having the minor heap live in L1 cache, seems to me 
to be a big advantage.  If for no other reason than it makes minor 
collections a lot faster- the collector doesn't have to fault memory 
into cache, it's already there.

If anything, I'd be inclined to add more generations.  I haven't done 
any timings, but my first guess for reasonable values would be: Gen1 
(youngest): 32K (fits into L1 cache), Gen2: 256K (fits into L2 cache), 
Gen3: 8M (fits into memory), Gen4 (oldest): as large as necessary.