<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/07/02dc6d863fe3c0c547c14388c92e7bde"
  from="Christian Lindig &lt;lindig@e...&gt;"
  author="Christian Lindig"
  date="2003-07-10T06:52:40"
  subject="Re: [Caml-list] heap profiling"
  prev="2003/07/43c6e1f7fe38ab1e1d38f0639203f3c5"
  next="2003/07/fa560885a8e97b6dcf3961a0bd577aea"
  prev-in-thread="2003/07/b6c0eb092a38cd21aca4d7db57149ede"
  next-in-thread="2003/07/fa560885a8e97b6dcf3961a0bd577aea"
  prev-thread="2003/07/6ff247057e1f23c1558a197c6adcfe70"
  next-thread="2003/07/2a69eacc58f525bdc223410c31d18e6a"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] heap profiling">
<msg 
  url="2003/07/fb3da633abcfdc3f4bbdc870d13140cb"
  from="Fabrice Le Fessant &lt;lefessan@t...&gt;"
  author="Fabrice Le Fessant"
  date="2003-07-09T10:14:41"
  subject="[Caml-list] heap profiling">
<msg 
  url="2003/07/cf9f031cb8fe2aa58a960ccbe332159c"
  from="Jean-Christophe Filliatre &lt;Jean-Christophe.Filliatre@l...&gt;"
  author="Jean-Christophe Filliatre"
  date="2003-07-09T12:41:21"
  subject="Re: [Caml-list] heap profiling">
<msg 
  url="2003/07/35a2b34e4d401f2ef1c37c78601a6b4a"
  from="Fabrice Le Fessant &lt;lefessan@t...&gt;"
  author="Fabrice Le Fessant"
  date="2003-07-09T15:03:23"
  subject="Re: [Caml-list] heap profiling">
</msg>
</msg>
<msg 
  url="2003/07/b6c0eb092a38cd21aca4d7db57149ede"
  from="Norman Ramsey &lt;nr@e...&gt;"
  author="Norman Ramsey"
  date="2003-07-09T15:03:17"
  subject="Re: [Caml-list] heap profiling ">
</msg>
<msg 
  url="2003/07/02dc6d863fe3c0c547c14388c92e7bde"
  from="Christian Lindig &lt;lindig@e...&gt;"
  author="Christian Lindig"
  date="2003-07-10T06:52:40"
  subject="Re: [Caml-list] heap profiling">
</msg>
<msg 
  url="2003/07/fa560885a8e97b6dcf3961a0bd577aea"
  from="Christian Lindig &lt;lindig@e...&gt;"
  author="Christian Lindig"
  date="2003-07-10T08:04:16"
  subject="[Caml-list] expose GC roots as weak Obj.t pointers?">
<msg 
  url="2003/07/e9a447a146061fa5e4c4b9df266843c0"
  from="Damien Doligez &lt;Damien.Doligez@i...&gt;"
  author="Damien Doligez"
  date="2003-07-18T13:30:54"
  subject="Re: [Caml-list] expose GC roots as weak Obj.t pointers?">
</msg>
</msg>
</msg>
</thread>

<contents>
On Wed, Jul 09, 2003 at 12:10:52PM +0200, Fabrice Le Fessant wrote:
&gt; I would like to know if anybody has implemented some kind of
&gt; memory/heap usage profiling for the current version (3.06) of Ocaml,
&gt; [..] 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

</contents>

</message>

