Tiphaine Turpin a écrit : > Sylvain Le Gall a écrit : > >> 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. >> >> > But if it is just a matter of compaction, then > > (Gc.stat ()).Gc.live_words > > should give me a correct (small) result, no ? > > Tiphaine > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > You need to make sure that a complete GC cycle has run after producing your result, before (Gc.stat ()).Gc.live_words gives you what you want. The function you need is that one : val full_major : unit -> unit Do a minor collection, finish the current major collection cycle, and perform a complete new cycle. This will collect all currently unreachable blocks. You should make sure that variables with values holding large objects are not syntactically in the scope of any piece of code that can still be evaluated (I am not sure I am very clear). Here is a small example : let x = ... in (* here you are not sure x is collected even if the variable does not appear after this comment *) let y = 3 in ... Cheers, Christophe -- Christophe Raffalli Universite de Savoie Batiment Le Chablais, bureau 21 73376 Le Bourget-du-Lac Cedex tel: (33) 4 79 75 81 03 fax: (33) 4 79 75 87 42 mail: Christophe.Raffalli@univ-savoie.fr www: http://www.lama.univ-savoie.fr/~RAFFALLI --------------------------------------------- IMPORTANT: this mail is signed using PGP/MIME At least Enigmail/Mozilla, mutt or evolution can check this signature. The public key is stored on www.keyserver.net ---------------------------------------------