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 [EMAIL PROTECTED] _______________________________________________ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs