From: "Richard W.M. Jones" <rich@annexia.org>
To: "Maxime Ransan (BLOOMBERG/ 731 LEX)" <mransan@bloomberg.net>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Finding "lost" references to OCaml heap values
Date: Tue, 6 Oct 2015 16:57:29 +0100 [thread overview]
Message-ID: <20151006155729.GE20503@annexia.org> (raw)
In-Reply-To: <20151006155311.GC20503@annexia.org>
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
next prev parent reply other threads:[~2015-10-06 15:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-06 13:57 Maxime Ransan (BLOOMBERG/ 731 LEX)
2015-10-06 15:53 ` Richard W.M. Jones
2015-10-06 15:57 ` Richard W.M. Jones [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-10-06 13:43 Richard W.M. Jones
2015-10-06 14:16 ` Richard W.M. Jones
2015-10-06 15:09 ` Gerd Stolpmann
2015-10-06 15:17 ` Gabriel Scherer
2015-10-06 15:54 ` Richard W.M. Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151006155729.GE20503@annexia.org \
--to=rich@annexia.org \
--cc=caml-list@inria.fr \
--cc=mransan@bloomberg.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox