English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Mastering the garbage collector
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-06-25 (15:14)
From: Sylvain Le Gall <sylvain@l...>
Subject: Re: Mastering the garbage collector
On 25-06-2009, Tiphaine Turpin <Tiphaine.Turpin@irisa.fr> wrote:
> Hi,
> I have difficulties with the garbage colloector. I have a program that
> use a lot of memory to build a small result, before doing something
> else. I expected all the memory but the result to be collected when
> doing a full_major, but this is not the case. I have tried to
> encapsulate all references to the large intermediate data in a function,
> compiling with -inline 0, but it does not work. Any idea ? More
> generally, is there a specification of the notion of root used by the
> garbage collector somewhere ?

You need to do a "Gc.compact" to size down. A full_major will collect but I
am not sure it will free allocated page.

Sylvain Le Gall