From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL,SUBJECT_EXCESS_QP autolearn=disabled version=3.1.3 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 7E4E3BC69 for ; Fri, 7 Dec 2007 11:45:15 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAL+yWEfUnw7Ulmdsb2JhbACCOI0fAgEBBwQGEREH X-IronPort-AV: E=Sophos;i="4.23,266,1194217200"; d="scan'208";a="6579086" Received: from ptb-relay01.plus.net ([212.159.14.212]) by mail3-smtp-sop.national.inria.fr with ESMTP; 07 Dec 2007 11:45:15 +0100 Received: from [80.229.56.224] (helo=beast.local) by ptb-relay01.plus.net with esmtp (Exim) id 1J0ahk-0005g0-8E for caml-list@yquem.inria.fr; Fri, 07 Dec 2007 10:45:12 +0000 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Questions on replacing finalizers and =?iso-8859-1?q?memory=09footprints?= Date: Fri, 7 Dec 2007 10:35:55 +0000 User-Agent: KMail/1.9.5 References: <4757D904.2090502@functionality.de> <475909E8.7010301@inria.fr> <4759241C.4070202@lri.fr> In-Reply-To: <4759241C.4070202@lri.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200712071035.55697.jon@ffconsultancy.com> X-Spam: no; 0.00; finalizers:01 footprints:01 filliatre:01 arrays:01 runtime:01 lri:01 filliatr:01 hash:01 hash:01 segfaults:01 frog:98 wrote:01 wrote:01 caml-list:01 tuples:01 On Friday 07 December 2007 10:44, Jean-Christophe Filli=E2tre wrote: > Xavier Leroy wrote: > >> Also, is there a simple way to implement a function (perhaps using > >> Obj.magic) which will walk a (possibly circular) network of tuples, > >> arrays, variadic entities and lists, and return the total number of > >> bytes used up by that structure? I see that this should be possible > >> in principle with the present implementation of the runtime if one > >> could get some basic information about the internal type of an > >> array. > > > > Jean-Christophe Filli=E2tre's "size" library does exactly this: > > > > http://www.lri.fr/~filliatr/software.en.html > > Indeed. However, note that it uses internally a hash table to store > blocks already considered (in order to correctly account for sharing), > and thus it is potentially incorrect if the GC moves some blocks during > the count, for instance during a resizing of the hash table (which > triggers the GC). I don't know how to avoid this issue; any help is > welcome. Yes. I wanted this functionality as well and tried your "size" library but = it=20 only segfaults on my machine. Presumably this must be written in C to avoid= =20 using the GC? Perhaps this would be a good product... :-) =2D-=20 Dr Jon D Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/products/?e