caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Christian Lindig <lindig@eecs.harvard.edu>
To: Fabrice Le Fessant <lefessan@tyminouch.dyndns.org>
Cc: Caml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] heap profiling
Date: Wed, 9 Jul 2003 22:52:47 +0200	[thread overview]
Message-ID: <20030709205247.GA404@eecs.harvard.edu> (raw)
In-Reply-To: <16139.59948.178030.241482@tyminouch.dyndns.org>

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


  parent reply	other threads:[~2003-07-10  6:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-09 10:10 Fabrice Le Fessant
2003-07-09 12:33 ` Jean-Christophe Filliatre
2003-07-09 14:59   ` Fabrice Le Fessant
     [not found] ` <lefessan@tyminouch.dyndns.org>
2003-07-09 15:03   ` Norman Ramsey
2003-07-09 20:52 ` Christian Lindig [this message]
2003-07-10  8:02 ` [Caml-list] expose GC roots as weak Obj.t pointers? Christian Lindig
2003-07-18 13:30   ` Damien Doligez

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=20030709205247.GA404@eecs.harvard.edu \
    --to=lindig@eecs.harvard.edu \
    --cc=caml-list@inria.fr \
    --cc=lefessan@tyminouch.dyndns.org \
    /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).