caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jeremy Yallop <yallop@gmail.com>
To: jean-vincent.loddo@lipn.univ-paris13.fr
Cc: Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] Memory leaks generated by Scanf.fscanf?
Date: Fri, 20 Jun 2014 14:01:52 +0100	[thread overview]
Message-ID: <CAAxsn=GkMuQz_hNqRLxsRbRpK0GxOf_3ZFFq_02bkM_Y95h3Cg@mail.gmail.com> (raw)
In-Reply-To: <e9dba6f33347ae197b0fc1f1974001b0@lipn.univ-paris13.fr>

On 20 June 2014 13:29,  <jean-vincent.loddo@lipn.univ-paris13.fr> wrote:
> working on Marionnet (https://launchpad.net/marionnet), I noticed a serious
> memory leak making the system unusable after a few tens of minutes. After
> investigation, the problem seems to be related to Scanf.fscanf.

It looks like your leak is caused by the 'memo' table in the Scanf
module that associates a lookahead buffer with each input channel:

   https://github.com/ocaml/ocaml/blob/trunk/stdlib/scanf.ml#L393

as explained by a comment in the Scanf code:

   https://github.com/ocaml/ocaml/blob/trunk/stdlib/scanf.ml#L268-L320

Entries are added to the table for each input channel used for
scanning, but there's no mechanism for removing entries.  This would
be worth raising on Mantis.

  reply	other threads:[~2014-06-20 13:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-20 12:29 jean-vincent.loddo
2014-06-20 13:01 ` Jeremy Yallop [this message]
2014-06-20 15:35   ` Gabriel Scherer
2014-06-22 17:11     ` Benoît Vaugon
2014-06-23  9:06       ` François Bobot
2014-06-27 14:32   ` Jeremy Yallop

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='CAAxsn=GkMuQz_hNqRLxsRbRpK0GxOf_3ZFFq_02bkM_Y95h3Cg@mail.gmail.com' \
    --to=yallop@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=jean-vincent.loddo@lipn.univ-paris13.fr \
    /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;
as well as URLs for NNTP newsgroup(s).