Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Memory Profiler
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-03-12 (11:00)
From: Xavier Leroy <Xavier.Leroy@i...>
Subject: Re: [Caml-list] Memory Profiler
> I am looking for a memory profiler à la gprof for the native OCaml compiler.
> I would be interested by the memory consumption (let's say in bytes) of
> each function, something similar to gprof results but for memory. On your
> shelf ?

We do not have any such tools currently, but I agreee we need a memory

There are two ways to go about it.  One is to count allocations, as
you propose.  This might be feasible by inserting counters (like
ocamlprof does) at allocation sites.

However, a point can be made that this is not what you want to know:
short-lived allocations consume time, but do not consume memory.  So,
the other direction os to profile live heap data (as a function of
time) and be able to trace it back to its allocation sites.  This is a
lot harder to do, and we currently do not know how to do this.
However, there has been interesting work in this direction for Haskell
(the work of Colin Runciman and colleagues) and also for Scheme
(Manuel Serrano's memory debugger for the Bigloo system).

- Xavier Leroy
To unsubscribe, mail  Archives: