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
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: -- (:)
From: Sylvain Le Gall <sylvain@l...>
Subject: Re: Mastering the garbage collector
On 25-06-2009, Tiphaine Turpin <> 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