From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id IAA05399; Thu, 10 Jul 2003 08:52:40 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id IAA08141 for ; Thu, 10 Jul 2003 08:52:38 +0200 (MET DST) Received: from lindig.dyndns.org (dialin-145-254-141-106.arcor-ip.net [145.254.141.106]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h6A6qZT07006 for ; Thu, 10 Jul 2003 08:52:35 +0200 (MET DST) Received: by lindig.dyndns.org (Postfix, from userid 1002) id B06143D9F; Wed, 9 Jul 2003 22:52:47 +0200 (CEST) Date: Wed, 9 Jul 2003 22:52:47 +0200 From: Christian Lindig To: Fabrice Le Fessant Cc: Caml Mailing List Subject: Re: [Caml-list] heap profiling Message-ID: <20030709205247.GA404@eecs.harvard.edu> Mail-Followup-To: Christian Lindig , Fabrice Le Fessant , Caml Mailing List References: <16139.59948.178030.241482@tyminouch.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16139.59948.178030.241482@tyminouch.dyndns.org> X-No-Archive: yes X-URL: http://www.eecs.harvard.edu/~lindig/ User-Agent: Mutt/1.5.4i X-Loop: caml-list@inria.fr X-Spam: no; 0.00; lindig:01 caml-list:01 implemented:01 3.06:01 drag:01 finalizers:01 ocaml:01 garbage:01 0200,:01 heap:03 wrote:03 eecs:03 anybody:03 data:03 fabrice:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, Jul 09, 2003 at 12:10:52PM +0200, Fabrice Le Fessant wrote: > I would like to know if anybody has implemented some kind of > memory/heap usage profiling for the current version (3.06) of Ocaml, > [..] Anybody plans to implement such a tool ? No plans, but some thoughts. The time between the last use of a block and its collection by the GC is called drag time. High drag times are typical for leaked memory. To detect leaked blocks, a block is time stamped when it is read or written, and the GC checks the drag time when it finds the block dead. Blocks whose drag time exceeds a threshold are logged. Time stamps and source code locations require additional room in blocks. They main difficulty is to detect that a block is garbage such that its drag time can be observed. I do know that custom blocks can have finalizers and therefore at least they are individually identified as garbage. I don't know whether this is true for other values in the OCaml GC. When the GC only scans the live data it may be difficult to detect garbage block by block. Any GC expert around to answer this question? Does OCaml free all memory before exit? This would be useful to find the memory that is otherwise never collected. -- Christian ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners