From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id AFE92BBAF for ; Tue, 23 Nov 2010 17:43:56 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ar0EAJZ+60zBMHhLhWdsb2JhbACiZxUBAQEKCwoFEyK+J4VLBIoTg1o X-IronPort-AV: E=Sophos;i="4.59,242,1288566000"; d="asc'?scan'208";a="89194415" Received: from net.univ-savoie.fr ([193.48.120.75]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/EDH-RSA-DES-CBC3-SHA; 23 Nov 2010 17:43:56 +0100 Received: from post.bourget.univ-savoie.fr (post.bourget.univ-savoie.fr [193.48.120.73]) by net.univ-savoie.fr (8.12.3/jtpda-5.4) with ESMTP id oANGhrMH019697 ; Tue, 23 Nov 2010 17:43:53 +0100 Received: from [193.48.123.45] (d45.lama.univ-savoie.fr [193.48.123.45]) by post.bourget.univ-savoie.fr (8.12.3/jtpda-5.4) with ESMTP id oANGhjOK015351 ; Tue, 23 Nov 2010 17:43:45 +0100 Message-ID: <4CEBEF43.10800@univ-savoie.fr> Date: Tue, 23 Nov 2010 17:43:47 +0100 From: Christophe Raffalli User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101027 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Christophe Raffalli Cc: Damien Doligez , OCaml mailing list Subject: Re: [Caml-list] Optimizing garbage collection References: <1832704169.1010021.1290451094930.JavaMail.root@zmbs1.inria.fr> <81B1F99F-1875-4FFE-B01A-4D0A5EE50463@inria.fr> <4CEBC432.1090804@univ-savoie.fr> In-Reply-To: <4CEBC432.1090804@univ-savoie.fr> X-Enigmail-Version: 1.1.2 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig7C7657F444A07669D60B521D" X-Scanned-By: MIMEDefang 2.33 (www . roaringpenguin . com / mimedefang) X-Spam: no; 0.00; christophe:01 raffalli:01 christophe:01 raffalli:01 univ-savoie:01 reasonnable:01 reasonnable:01 printf:01 fprintf:01 stderr:01 stderr:01 printf:01 fprintf:01 chablais:01 73376:01 X-Attachments: type="application/pgp-signature" name="signature.asc" name="signature.asc" This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig7C7657F444A07669D60B521D Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Le 23/11/2010 14:40, Christophe Raffalli a =E9crit : >=20 > Hello, >=20 > May be running a minimisation algorithm to minimize (promoted_words per= > minor collection / minor_heap_size) Could be good ? >=20 This was stupid has it converges toward zero when we increase minor_heap_= size. However, the following piece of code worked well for PML benchmark (4'30"= became 3'02") : (remark that HALVING the minor_heap_size does occur too) I really do not know if such strategy is reasonnable as a default ? If the 0.10 and 0.005 in the code are any reasonnable ? -------------------8<--------------------- open Gc let param =3D get () let old_promoted_words =3D ref 0.0 let old_minor_collections =3D ref 0 let minor_heap_size =3D ref param.minor_heap_size let _ =3D create_alarm (fun () -> let s =3D quick_stat () in let promoted_words =3D s.promoted_words in let minor_collections =3D s.minor_collections in let delta_promoted_words =3D promoted_words -. !old_promoted_words in let delta_minor_collections =3D minor_collections - !old_minor_collecti= ons in old_promoted_words :=3D promoted_words; old_minor_collections :=3D minor_collections; let ratio =3D delta_promoted_words /. (float) delta_minor_collections /. (float) !minor_heap_size in if ratio > 0.10 then begin minor_heap_size :=3D !minor_heap_size * 2; (* Printf.fprintf stderr "MHS DOUBLED <- %d (ratio %f)\n" !minor_heap_si= ze ratio; flush stderr; *) set { get () with minor_heap_size =3D !minor_heap_size } end else if ratio < 0.005 then begin minor_heap_size :=3D max 32768 (!minor_heap_size / 2); (* Printf.fprintf stderr "MHS HALFED <- %d (ratio %f)\n" !minor_heap_siz= e ratio; flush stderr; *) set { get () with minor_heap_size =3D !minor_heap_size } end) -------------------8<--------------------- --=20 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 --------------------------------------------- --------------enig7C7657F444A07669D60B521D Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkzr70MACgkQi9jr/RgYAS4jtgCfQpRZJ4eRALV96Lac1ly+mKsa dBsAoLvJQpaaLKr7G+hAqjnDbPrjSJkF =Ez0q -----END PGP SIGNATURE----- --------------enig7C7657F444A07669D60B521D--