<?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/11/974acf8ee1bf674c02076f709368a862"
  from="Damien Doligez &lt;damien.doligez@i...&gt;"
  author="Damien Doligez"
  date="2003-11-21T16:45:52"
  subject="Re: [Caml-list] Accuracy of Gc.stat ()"
  prev="2003/11/be91a61f7033646f9301d5de206fc31b"
  next="2003/11/9df36749b91cbf1ae99c832a13bb0042"
  prev-in-thread="2003/11/f5ceb88194f4324b692f89b6f3398ff2"
  next-in-thread="2003/11/002147abdef4f6fe5248093cd8c75a75"
  prev-thread="2003/11/b9a42a206431fb25d03c3e4bf43cc125"
  next-thread="2003/11/58c657c03c7683b0214401b6eee2a21f"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Accuracy of Gc.stat ()">
<msg 
  url="2003/11/f5ceb88194f4324b692f89b6f3398ff2"
  from="Daniel_Bünzli &lt;daniel.buenzli@e...&gt;"
  author="Daniel_Bünzli"
  date="2003-11-19T17:52:08"
  subject="[Caml-list] Accuracy of Gc.stat ()">
<msg 
  url="2003/11/974acf8ee1bf674c02076f709368a862"
  from="Damien Doligez &lt;damien.doligez@i...&gt;"
  author="Damien Doligez"
  date="2003-11-21T16:45:52"
  subject="Re: [Caml-list] Accuracy of Gc.stat ()">
</msg>
<msg 
  url="2003/11/002147abdef4f6fe5248093cd8c75a75"
  from="Kim Nguyen &lt;nguyen@b...&gt;"
  author="Kim Nguyen"
  date="2003-11-22T00:18:27"
  subject="Re: [Caml-list] Accuracy of Gc.stat ()">
<msg 
  url="2003/11/b0824ff17e581379b1c4a9a60ef71fb5"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2003-11-22T11:44:11"
  subject="Re: [Caml-list] Accuracy of Gc.stat ()">
<msg 
  url="2003/11/8f2405258c33a120ad0ca9f46f985eb6"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2003-11-22T11:49:12"
  subject="Re: [Caml-list] Accuracy of Gc.stat ()">
<msg 
  url="2003/11/47c7a7b20eb96e9e1835662fe1651255"
  from="Daniel_Bünzli &lt;daniel.buenzli@e...&gt;"
  author="Daniel_Bünzli"
  date="2003-11-22T14:20:36"
  subject="Self-detection of native code execution (Was Re: [Caml-list] Accuracy of Gc.stat ())">
<msg 
  url="2003/11/26ef24002e41d7ebabfb7229a3904059"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2003-11-22T14:28:54"
  subject="Re: Self-detection of native code execution (Was Re: [Caml-list] Accuracy of Gc.stat ())">
</msg>
</msg>
<msg 
  url="2003/11/92dbb3eff27c1305dfb13cc95807a0c3"
  from="Kim Nguyen &lt;nguyen@b...&gt;"
  author="Kim Nguyen"
  date="2003-11-22T14:25:55"
  subject="Re: [Caml-list] Accuracy of Gc.stat ()">
<msg 
  url="2003/11/6ee5dd7ed01812dc5e6b44c4bdc4eaff"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2003-11-22T14:31:14"
  subject="Re: [Caml-list] Accuracy of Gc.stat ()">
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
On Wednesday, November 19, 2003, at 06:52 PM, Daniel Bünzli wrote:

&gt; Since my first attempt [1] didn't really get through, I try to 
&gt; reformulate my post.

Sorry I didn't answer earlier, the traffic on caml-list is getting
quite heavy these days.

&gt; 1) What is the accuracy of these results ?
&gt;
&gt; E.g. I read in the documentation of the Gc module that the field 
&gt; minor_words is only an approximation in programs compiled to native 
&gt; code.

Because of the way we trigger a minor collection in native code, the
counters will overestimate the number of words allocated by a few words
per minor GC.  Note that it is always an overestimation, and the error
is at most 256 words per collection.

&gt;  Is it also true for the other fields ?

No.  The other fields are accurate.

&gt;  Would the figure minor+major-promoted be accurate ?

No.  The error in minor will propagate.

&gt;  How much can I trust the figures I get ?

You can repeat your experiment after changing the size of the
minor heap, that will give you a good idea of the error.  The
bigger the heap, the smaller the error, and it converges to
error=0 for an infinite heap.

&gt; 2) When I start profiling should I prefer a Gc.compact to a 
&gt; Gc.full_major ?

If you're only interested in minor+major-promoted, you don't even
need a Gc.full_major.  A Gc.compact would be if you are timing a
very allocation-intensive program, and even then I doubt it will
make much difference.

&gt; 3) Is it possible to know at runtime whether we are running native 
&gt; code or interpreted bytecode ?

Good question.  I don't know the answer.  Maybe you should file this
as a feature wish in the bug tracking system:
&lt; http://caml.inria.fr/bin/caml-bugs &gt;.

&gt; Regarding time profiling, a binding in the Unix module to the 
&gt; getrusage() function would definitvely be nice.

Another candidate for the bug tracking system.

-- Damien

-------------------
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>

