From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q31Jw5l2001906 for ; Sun, 1 Apr 2012 21:58:05 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EABmzeE9QRFuw/2dsb2JhbABCuQqBB4IJAQEFOj8QCxgcEhQoIYggB7YjBIVNimxjBJVgkDCCaA X-IronPort-AV: E=Sophos;i="4.75,353,1330902000"; d="scan'208";a="138590531" Received: from furbychan.cocan.org ([80.68.91.176]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/AES256-SHA; 01 Apr 2012 21:57:35 +0200 Received: from rich by furbychan.cocan.org with local (Exim 4.72) (envelope-from ) id 1SEQu5-00072C-Vf; Sun, 01 Apr 2012 20:57:33 +0100 Date: Sun, 1 Apr 2012 20:57:33 +0100 From: "Richard W.M. Jones" To: Hans Ole Rafaelsen Cc: caml-list@inria.fr Message-ID: <20120401195733.GB15870@annexia.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: [Caml-list] Strategies for finding memory leaks On Wed, Mar 21, 2012 at 10:49:22AM +0100, Hans Ole Rafaelsen wrote: > Hello, > > Is there some tools / tricks that can be used to help find memory leaks? [...] > The application uses several 3rd party libraries, including: LablGTK2, > OCamlNet, LWT and others. If you suspect a leak in the *C* part of your program or these libraries, then I am very successfully using valgrind on my OCaml (native) programs to track such leaks. https://github.com/libguestfs/libguestfs/blob/95123a9144edc1ddb3ad67d75276ca3af70eddb8/tests/extra/Makefile.am Note that several of the programs tested are written in OCaml, and see also the 'suppressions' file in the same directory. However this will not find leaks in OCaml code. Although I was pleasantly surprised the other day when valgrind pointed correctly to a use of an uninitialized string in some OCaml code. Rich. -- Richard Jones Red Hat