From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 D15EF7FC6C for ; Tue, 6 Oct 2015 17:57:30 +0200 (CEST) IronPort-PHdr: 9a23:hSJDAh8HDef0+/9uRHKM819IXTAuvvDOBiVQ1KB80+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: A0CVCADt7hNW/7BbRFBeg0Y1bgGpQQUBAQEBAQEFAYENk1KBWiGFeQKBcRIBAQEBAQEBAYEJgh2CCAEBBDo/EAsYCSUPBSghiEUBCL9MAQEBAQEFAQEBAR6GLD6FB4UNB4MagRQFhUCNDYM3AYUXhUmCLoInmU8oAziEAz0zAQGIPQEBAQ X-IPAS-Result: A0CVCADt7hNW/7BbRFBeg0Y1bgGpQQUBAQEBAQEFAYENk1KBWiGFeQKBcRIBAQEBAQEBAYEJgh2CCAEBBDo/EAsYCSUPBSghiEUBCL9MAQEBAQEFAQEBAR6GLD6FB4UNB4MagRQFhUCNDYM3AYUXhUmCLoInmU8oAziEAz0zAQGIPQEBAQ X-IronPort-AV: E=Sophos;i="5.17,644,1437429600"; d="scan'208";a="149797886" 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:57:30 +0200 Received: from rich by furbychan.cocan.org with local (Exim 4.84) (envelope-from ) id 1ZjUcL-0005sc-Dp; Tue, 06 Oct 2015 16:57:29 +0100 Date: Tue, 6 Oct 2015 16:57:29 +0100 From: "Richard W.M. Jones" To: "Maxime Ransan (BLOOMBERG/ 731 LEX)" Cc: caml-list@inria.fr Message-ID: <20151006155729.GE20503@annexia.org> References: <5613D36001C106E20039047E_0_58858@p057> <20151006155311.GC20503@annexia.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151006155311.GC20503@annexia.org> 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 04:53:11PM +0100, Richard W.M. Jones wrote: > 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. I was going to add here: ... because it's hard to choose good values! What's a good 'used' for a libguestfs handle that might consume 100 MB? And what's a good 'max' (maybe total physical RAM)? Also, suppose I choose a large used/max (1/1 for example), is there a danger that the major GC will do too much work? The manual is unclear on whether a bad choice of used/max can cause negative effects. Rich. -- Richard Jones Red Hat