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-list] GC and caml_oldify_local_roots taking too much time
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-07-19 (13:32)
From: Christophe Raffalli <christophe.raffalli@u...>
Subject: Re: [Caml-list] GC and caml_oldify_local_roots taking too much time
Damien Doligez wrote:
> On Jul 19, 2004, at 19:59, Christophe Raffalli wrote:
>> What could cause the increase of time spent in caml_oldify_local_roots ?
>> And what is this function in the first place ?
> It is the function that finds the roots of the memory graph:
> 1. in the stack
> 2. in the global C roots
> 3. among finalised values
> 4. in the stacks of other threads, if any
> I guess your program does one or more of the following:
> 1. allocate lots of stack space (deep recursion)

That's not the case, I am in a while loop so recursion depth is bounded

> 2. declare lots of C roots (with caml_register_global_root)

That may be a bug in the lablGL code ... I had a short look but found 

> 3. launch lots of threads that allocate big stacks

I launch only two threads (native posix threads)

> I don't think finalised values can be the problem, because this
> particular set of roots is emptied after each minor collection.

I removed call to finalise and saw no change. Anyway I have always less 
than 10 not collected object with finaliser.

> It should be possible to do something better for case (2), but
> if you declare arbitrary amounts of C roots, you will still pay
> the price at each major collection (instead of each minor
> collection as it is now).

I will look better at lablGL/Glut code now.


> -- Damien
> -------------------
> To unsubscribe, mail Archives: 
> Bug reports: FAQ: 
> Beginner's list:

Christophe Raffalli
Université de Savoie
Batiment Le Chablais, bureau 21
73376 Le Bourget-du-Lac Cedex

tél: (33) 4 79 75 81 03
fax: (33) 4 79 75 87 42
IMPORTANT: this mail is signed using PGP/MIME
At least Enigmail/Mozilla, mutt or evolution
can check this signature

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: