From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 1BA747F7AF for ; Tue, 6 Oct 2015 17:53:15 +0200 (CEST) IronPort-PHdr: 9a23:U7dYzh/vQNvXkf9uRHKM819IXTAuvvDOBiVQ1KB80+8cTK2v8tzYMVDF4r011RmSDdmdtKsP0bWempujcFJDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXsq3G/pQQfBg/4fVIsYL+lRsiN1o/tiKibwN76XUZhvHKFe7R8LRG7/036l/I9ps9cEJs30QbDuXBSeu5blitCLFOXmAvgtI/rpMYwuwwZgf8q9tZBXKPmZOx4COUAVHV1e1wysYfOvAnCSAbH3HIaSWwQ2lpiJy/iyTvXZLi2+nSh76JZ9Rnbd4WiSKo9Xy+r6Y9hTBjvjS0KLTF/9mzL3J9elqVe9Vibphd/ypTYKL7TEbw2XKTbcMhQDT5bX81RfyVHBI6sboJJCPAOa7UL57LhrkcD+EPtTTKnA/nin3oR3if7 Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=rich@annexia.org; spf=Pass smtp.mailfrom=rich@annexia.org; spf=None smtp.helo=postmaster@furbychan.cocan.org Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of rich@annexia.org) identity=pra; client-ip=80.68.91.176; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="rich@annexia.org"; x-sender="rich@annexia.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of rich@annexia.org designates 80.68.91.176 as permitted sender) identity=mailfrom; client-ip=80.68.91.176; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="rich@annexia.org"; x-sender="rich@annexia.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@furbychan.cocan.org) identity=helo; client-ip=80.68.91.176; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="rich@annexia.org"; x-sender="postmaster@furbychan.cocan.org"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CXCADp7RNW/7BbRFBeg0Y1bgGpQQUBAQEBAQEFAYENlSwhhXkCgXERAQEBAQEBAQGBCYIdgggBAQQ6PxALGAklDwUoIYhFAQi/UAEBAQEBBQEBAQEehiw+hQeFDQeDGoEUBYVAjQ2DNwGFF4VJgi6BdDOZTzcshAM9MwEBiD0BAQE X-IPAS-Result: A0CXCADp7RNW/7BbRFBeg0Y1bgGpQQUBAQEBAQEFAYENlSwhhXkCgXERAQEBAQEBAQGBCYIdgggBAQQ6PxALGAklDwUoIYhFAQi/UAEBAQEBBQEBAQEehiw+hQeFDQeDGoEUBYVAjQ2DNwGFF4VJgi6BdDOZTzcshAM9MwEBiD0BAQE X-IronPort-AV: E=Sophos;i="5.17,644,1437429600"; d="scan'208";a="149797457" Received: from annexia.org (HELO furbychan.cocan.org) ([80.68.91.176]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 06 Oct 2015 17:53:13 +0200 Received: from rich by furbychan.cocan.org with local (Exim 4.84) (envelope-from ) id 1ZjUYB-0005r1-PB; Tue, 06 Oct 2015 16:53:11 +0100 Date: Tue, 6 Oct 2015 16:53:11 +0100 From: "Richard W.M. Jones" To: "Maxime Ransan (BLOOMBERG/ 731 LEX)" Cc: caml-list@inria.fr Message-ID: <20151006155311.GC20503@annexia.org> References: <5613D36001C106E20039047E_0_58858@p057> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5613D36001C106E20039047E_0_58858@p057> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [Caml-list] Finding "lost" references to OCaml heap values On Tue, Oct 06, 2015 at 01:57:52PM -0000, Maxime Ransan (BLOOMBERG/ 731 LEX) wrote: > Just a hint about why the destructor is not called is that when using caml_alloc_custom at https://github.com/libguestfs/libguestfs/blob/master/v2v/xml-c.c#L139, you are setting the used parameter to 0. > > As mentioned in http://caml.inria.fr/pub/docs/manual-ocaml-4.00/manual033.html#toc150 you can increase the ratio. A quick check would be to use a (used = 1, max = 1). I guess this probably doesn't have anything to do with this specific problem, since I'm calling the GC explicitly. However you're certainly correct that we don't pay any attention to passing decent values for caml_alloc_custom used/max. One reason is that almost all OCaml programs we have are relatively short running, so the pace of GC isn't much of an issue. In fact, we didn't notice that Gc.compact () was having "no effect" - it was only noticed by an outside contributor who was doing a particularly long v2v conversion and investigated further. Thanks, Rich. -- Richard Jones Red Hat