From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA08167; Mon, 23 Feb 2004 11:00:53 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA08771 for ; Mon, 23 Feb 2004 11:00:51 +0100 (MET) Received: from eris.rz.uni-saarland.de (eris.rz.uni-saarland.de [134.96.7.8]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i1NA0oae005703 for ; Mon, 23 Feb 2004 11:00:50 +0100 Received: from cs.uni-sb.de (cs.uni-sb.de [134.96.254.254]) by eris.rz.uni-saarland.de (SGI-8.12.5/8.12.10) with ESMTP id i1NA0muj22934146 for ; Mon, 23 Feb 2004 11:00:49 +0100 (CET) Received: from mail.cs.uni-sb.de (mail.cs.uni-sb.de [134.96.254.200]) by cs.uni-sb.de (8.12.11/2003091100) with ESMTP id i1NA0mO8027657 for ; Mon, 23 Feb 2004 11:00:48 +0100 (CET) Received: from mail.st.cs.uni-sb.de (goscinny.cs.uni-sb.de [134.96.235.32]) by mail.cs.uni-sb.de (8.12.11/2003073000) with ESMTP id i1NA0lOk025032 for ; Mon, 23 Feb 2004 11:00:47 +0100 (CET) X-Authentication-Warning: email: Host goscinny.cs.uni-sb.de [134.96.235.32] claimed to be mail.st.cs.uni-sb.de Received: from [134.96.235.101] (jonagold.cs.uni-sb.de [134.96.235.101]) by mail.st.cs.uni-sb.de (Postfix) with ESMTP id 62A8258000D for ; Mon, 23 Feb 2004 11:00:47 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v612) Content-Transfer-Encoding: 7bit Message-Id: <2225A9D9-65E7-11D8-B8C7-000A95DDB608@cs.uni-sb.de> Content-Type: text/plain; charset=US-ASCII; format=flowed To: Caml List From: Christian Lindig Subject: [Caml-list] design for ocaml heap profiler Date: Mon, 23 Feb 2004 11:00:39 +0100 X-Mailer: Apple Mail (2.612) X-AntiVirus: checked by AntiVir Milter 1.0.6; AVE 6.24.0.4; VDF 6.24.0.14 X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; lindig:01 lindig:01 uni-sb:01 ocaml's:01 alloc:01 alloc:01 val:01 runtime:01 crashes:01 mlvalues:01 runtime:01 run-time:01 compiler:01 interp:01 ocaml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk To complete OCaml's toolbox I'd like to have a heap profiler that tracks allocation of memory. As a first step, I'd like to augment each heap-allocated block with the address of the instruction that allocated it. Then the GC could write out a trace that shows where all the live memory comes from. My first idea was to change the the block-allocation instructions in the bytecode interpreter such that they allocate one additional slot to hold the current address' instruction: #define Alloc_small_hp(b,n,t) \ do{Alloc_small(b,(n)+1,t);Field(b,n)=Val_int(pc);}while(0) Use Alloc_small_hp instead of Alloc_small in in interp.c Only the runtime systems knows about the additional slot and I expected the generated code never to touch the new slot. However, it does not work, the compiler crashes, and I could not find out why. A better design would reserve the new slot as part of the header; this requires to redefine the macros in mlvalues.h. Has anybody tried to enlarge the header? It would be very nice if the header could be enlarged by a configurable number n of slots, where n=0 for the production runtime system. I appreciate any advice about how to enlarge heap blocks for run-time information. -- 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