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=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 8BD12BC29 for ; Tue, 29 Aug 2006 17:19:45 +0200 (CEST) Received: from [128.93.8.130] (macadam.inria.fr [128.93.8.130]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k7TFJjBj032136 for ; Tue, 29 Aug 2006 17:19:45 +0200 Mime-Version: 1.0 (Apple Message framework v752.2) In-Reply-To: <44F3BFA7.20202@cs.umn.edu> References: <44F3BFA7.20202@cs.umn.edu> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <8B65BEE5-D101-4B39-98DD-3B68608702AC@inria.fr> Content-Transfer-Encoding: 7bit From: Damien Doligez Subject: Re: [Caml-list] Garbage collection and caml_adjust_gc_speed Date: Tue, 29 Aug 2006 17:20:16 +0200 To: OCaml X-Mailer: Apple Mail (2.752.2) X-Miltered: at nez-perce with ID 44F45B11.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; damien:01 damien:01 ocaml:01 computations:01 bigarray:01 lacaml:01 alloc:01 heap:01 bigarrays:01 surprising:01 computations:01 2006:98 wrote:01 doligez:01 doligez:01 On 2006-08-29, at 06:16, Christopher Kauffman wrote: > I am finishing up my first major research application written in > OCaml. The code is a scientific application which does a moderate > amount of floating point computations for which I have employed the > Bigarray library and the Lacaml package. [...] > What concerns me is the large overhead I seem to be getting from > the first function, 'caml_adjust_gc_speed', which I assume is > related to the garbage collector. Over 4 million calls to this > function seems a little much. I attempted to play with a garbage > collection parameter, the value of control.space_overhead in the Gc > module. According to the manual, this affects the major GC speed > and increasing the value is supposed to cut down on the > aggressiveness of the GC. Setting space_overhead to 99 did not > change number of calls to 'caml_adjust_gc_speed'. caml_adjust_gc_speed is called by caml_alloc_custom to tell it about resources (in this case, memory) outside the heap that depend on the allocated block. None of the GC parameter can reduce this number. I guess your program allocated over 4 million bigarrays. What I find surprising is that this simple function would dominate the run time of your program. I suspect some problem with gprof. Could you give us more details about the computations performed by your program? -- Damien