* [Caml-list] heap profiling
@ 2003-07-09 10:10 Fabrice Le Fessant
2003-07-09 12:33 ` Jean-Christophe Filliatre
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Fabrice Le Fessant @ 2003-07-09 10:10 UTC (permalink / raw)
To: caml-list
Hi,
I would like to know if anybody has implemented some kind of
memory/heap usage profiling for the current version (3.06) of Ocaml,
giving for example the amount of live data in the heap allocated by
each function or module ? or the amount of data retained by some root ?
Anybody plans to implement such a tool ?
- Fabrice
-------------------
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Caml-list] heap profiling
2003-07-09 10:10 [Caml-list] heap profiling 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>
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Jean-Christophe Filliatre @ 2003-07-09 12:33 UTC (permalink / raw)
To: Fabrice Le Fessant; +Cc: caml-list
Fabrice Le Fessant writes:
>
> I would like to know if anybody has implemented some kind of
> memory/heap usage profiling for the current version (3.06) of Ocaml,
> giving for example the amount of live data in the heap allocated by
> each function or module ? or the amount of data retained by some root ?
> Anybody plans to implement such a tool ?
Regarding the last point (the amount of data used by some ocaml
values(s)), I implemented a small module Size for this purpose. It is
available at http://www.lri.fr/~filliatr/software.en.html
Hope this helps,
--
Jean-Christophe Filliâtre (http://www.lri.fr/~filliatr)
-------------------
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
^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <lefessan@tyminouch.dyndns.org>]
* Re: [Caml-list] heap profiling
2003-07-09 10:10 [Caml-list] heap profiling Fabrice Le Fessant
2003-07-09 12:33 ` Jean-Christophe Filliatre
[not found] ` <lefessan@tyminouch.dyndns.org>
@ 2003-07-09 20:52 ` Christian Lindig
2003-07-10 8:02 ` [Caml-list] expose GC roots as weak Obj.t pointers? Christian Lindig
3 siblings, 0 replies; 7+ messages in thread
From: Christian Lindig @ 2003-07-09 20:52 UTC (permalink / raw)
To: Fabrice Le Fessant; +Cc: Caml Mailing List
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Caml-list] expose GC roots as weak Obj.t pointers?
2003-07-09 10:10 [Caml-list] heap profiling Fabrice Le Fessant
` (2 preceding siblings ...)
2003-07-09 20:52 ` Christian Lindig
@ 2003-07-10 8:02 ` Christian Lindig
2003-07-18 13:30 ` Damien Doligez
3 siblings, 1 reply; 7+ messages in thread
From: Christian Lindig @ 2003-07-10 8:02 UTC (permalink / raw)
To: Caml Mailing List
Would it be possible (in principle) to expose the GC roots as an array
of weak Obj.t pointers? This would allow to walk the heap from Caml
using Obj.
Gc.roots: unit -> Obj.t Weak.t
-- 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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2003-07-18 13:30 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-09 10:10 [Caml-list] heap profiling 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
2003-07-10 8:02 ` [Caml-list] expose GC roots as weak Obj.t pointers? Christian Lindig
2003-07-18 13:30 ` Damien Doligez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox