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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 8803C7F947 for ; Fri, 20 Jun 2014 15:01:55 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of yallop@gmail.com) identity=pra; client-ip=74.125.82.43; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="yallop@gmail.com"; x-sender="yallop@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of yallop@gmail.com designates 74.125.82.43 as permitted sender) identity=mailfrom; client-ip=74.125.82.43; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="yallop@gmail.com"; x-sender="yallop@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wg0-f43.google.com) identity=helo; client-ip=74.125.82.43; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="yallop@gmail.com"; x-sender="postmaster@mail-wg0-f43.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap4BAO8vpFNKfVIrlGdsb2JhbABZg19agm2nNwEGmSoBfggWDwEBAQEHCwsJEiqEAwEBAQQSER0BGx0BAwwGBQsNAgImAgIiAREBBQEcGQgaiAsBAxENoDxqiyeBcoMPkh4KGScNZYVhEQEBBAyBHoQ4iRQHFoJhgUwBA5pEkWkYKYRzPC8 X-IPAS-Result: Ap4BAO8vpFNKfVIrlGdsb2JhbABZg19agm2nNwEGmSoBfggWDwEBAQEHCwsJEiqEAwEBAQQSER0BGx0BAwwGBQsNAgImAgIiAREBBQEcGQgaiAsBAxENoDxqiyeBcoMPkh4KGScNZYVhEQEBBAyBHoQ4iRQHFoJhgUwBA5pEkWkYKYRzPC8 X-IronPort-AV: E=Sophos;i="5.01,514,1400018400"; d="scan'208";a="81131160" Received: from mail-wg0-f43.google.com ([74.125.82.43]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 20 Jun 2014 15:01:55 +0200 Received: by mail-wg0-f43.google.com with SMTP id b13so3626854wgh.26 for ; Fri, 20 Jun 2014 06:01:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=qkAw4Ybrtr1nIEUfPw5qW6jZztd7WjQ2+uZajtEyJZE=; b=qnsP75J1xdHO/JUt8mOIJlXIwtiCdoh7fGqwpN0JvPyGKyaIyY1XYS/Rc+9QEpwb9U 7d774cWuC1tSQ9axPeexdXLXTqWslNqECuuyTb1FjUbMS2Ai8lYFf2jO88jKRrqt5+Mi m6UfGdj/Y0zgcXVDyDQETL8cp++FuIWUiQMOG7dLXxD3OWbf9vuVDMQbVRzL/WFXFnt0 ZZAKnFp9PXH1myPTqNqBu9FDl5/qarFqrV1SixO0jQUYVBx7kUQefFWP2bqceP1na36J fzA671KAcKwTJmmtMcBb+jYmh+OXxuJN9b5lmEjV4lyKXSpIXDU7fuOSrvPIPl5HD5wb H6FA== MIME-Version: 1.0 X-Received: by 10.180.74.131 with SMTP id t3mr4050597wiv.23.1403269312380; Fri, 20 Jun 2014 06:01:52 -0700 (PDT) Received: by 10.216.219.193 with HTTP; Fri, 20 Jun 2014 06:01:52 -0700 (PDT) In-Reply-To: References: Date: Fri, 20 Jun 2014 14:01:52 +0100 Message-ID: From: Jeremy Yallop To: jean-vincent.loddo@lipn.univ-paris13.fr Cc: Caml List Content-Type: text/plain; charset=UTF-8 Subject: Re: [Caml-list] Memory leaks generated by Scanf.fscanf? On 20 June 2014 13:29, 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.