caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Memory statistics tool
@ 2008-07-23 10:54 Dr. Thomas Fischbacher
  2008-07-23 11:47 ` [Caml-list] " Daniel Bünzli
  2008-07-23 12:44 ` dmitry grebeniuk
  0 siblings, 2 replies; 10+ messages in thread
From: Dr. Thomas Fischbacher @ 2008-07-23 10:54 UTC (permalink / raw)
  To: Caml-list List


Dear OCaml folks,

when building large applications that work on complicated and highly
networked data, one issue that easily comes up is to get some idea
about what chunks of data eat all your memory. Now, it would be
marvellous for data structure optimization purposes if there were a
function

memory_footprint: 'a -> int64 (or maybe float),

which takes as argument a root
(e.g. Obj.magic [|Obj.magic firstthingy; Obj.magic secondthingy;
       Obj.magic thirdthingy|])
and tells me how many cells are occupied by those ML data structures
reachable from that root. Basically, this would correspond to using
the GC's traversal mechanism and doing some internal statistics at the
same time. My guess would be that the Marshal module "almost" has such
a function already, to determine the amount of memory required to hold
a string-serialized value. But as these values get compacted, the length
of the string does not correspond to the number of words occupied by the
in-memory data.

Is there already something like that? Has anyone already built such
a tool?

-- 
best regards,
Thomas Fischbacher
t.fischbacher@soton.ac.uk




^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-07-24 16:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-23 10:54 Memory statistics tool Dr. Thomas Fischbacher
2008-07-23 11:47 ` [Caml-list] " Daniel Bünzli
2008-07-23 12:40   ` Jan Kybic
2008-07-23 12:44 ` dmitry grebeniuk
2008-07-23 13:09   ` Dr. Thomas Fischbacher
2008-07-23 13:16     ` Alain Frisch
2008-07-24 12:48       ` Dr. Thomas Fischbacher
2008-07-24 15:14         ` Alain Frisch
2008-07-24 15:44           ` Dr. Thomas Fischbacher
2008-07-24 16:12             ` Alain Frisch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).