<?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/01/6c61d8e53888e8cfe3bf0947f25afdad"
  from="Tom Hawkins &lt;tom1@l...&gt;"
  author="Tom Hawkins"
  date="2003-01-28T15:55:28"
  subject="[Caml-list] Memory Consumption and Profiling."
  prev="2003/01/b27956db968f8ee6e62241647f0e5287"
  next="2003/01/a9eacc471104d5641357ebc11c4a5688"
  prev-thread="2003/01/9a82dbd2b78af7a9bc331cc6f4371d1f"
  next-thread="2003/01/692002604f34e5a2f92c877c695585d4"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Memory Consumption and Profiling.">
<msg 
  url="2003/01/6c61d8e53888e8cfe3bf0947f25afdad"
  from="Tom Hawkins &lt;tom1@l...&gt;"
  author="Tom Hawkins"
  date="2003-01-28T15:55:28"
  subject="[Caml-list] Memory Consumption and Profiling.">
</msg>
</thread>

<contents>
Hi,

Can anyone offer tips for profiling a program for memory consumption?

One of my native compiled applications consumes a too much memory
and I'm having a hard time tracking down the source.  I did time 
profiling with gprof and here are the top four consumers:

Flat profile:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total
 time   seconds   seconds    calls   s/call   s/call  name
 21.66      2.38     2.38     1040     0.00     0.00  mark_slice
 12.28      3.73     1.35     1035     0.00     0.00  sweep_slice
 10.19      4.85     1.12 13611466     0.00     0.00  compare_val
  4.73      5.37     0.52  1804453     0.00     0.00  Hashtbl__find_117

I'm assuming mark_slice and sweep_slice are part of the garbage collector.
The nature of the program does create a lot of small data structures with
short life span, and my hunch this is where the problem lies.

Any tips?

Thanks,

Tom

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

