From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 7E872BC48 for ; Tue, 29 Mar 2005 20:17:01 +0200 (CEST) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.194]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j2TIH0R3008401 for ; Tue, 29 Mar 2005 20:17:01 +0200 Received: by wproxy.gmail.com with SMTP id 67so1186595wri for ; Tue, 29 Mar 2005 10:17:00 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=jQSeqSqxxZu9Cx0a5Y1etysgryn9+qZEdVP5DHd0WEj0f1Dd7pvaHKkr59TY2kwmlMHrRlmf5mbnahbXWq0L0yP01Ohst6dmho+pzNE4tEA9Tnv2sofUUqK9UImTnggZlf01qQzfbHONFbzdjAmlIfBxBskUkV4WYS4EV84oiXo= Received: by 10.54.8.18 with SMTP id 18mr1102756wrh; Tue, 29 Mar 2005 10:17:00 -0800 (PST) Received: by 10.54.80.17 with HTTP; Tue, 29 Mar 2005 10:17:00 -0800 (PST) Message-ID: <2a1a1a0c05032910175cdbae94@mail.gmail.com> Date: Tue, 29 Mar 2005 13:17:00 -0500 From: Mike Lin Reply-To: mikelin@mit.edu To: caml-list@yquem.inria.fr Subject: GC troubleshooting Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 42499B9C.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; allocating:01 iteration:01 heap:01 verbose:01 heap:01 computed:01 computed:01 iter:01 iteration:01 printf:01 stdout:01 megs:01 deallocated:01 tear:98 ...:98 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.2 X-Spam-Level: Hi folks, I'm not very experienced in troubleshooting fine GC issues, and unfortunately I have a situation where the GC is really grinding me to a halt. My program has a loop that needs to run about 20,000 times, allocating a handful of lists, roughly between 10 and 100 in length, in each iteration. The first 8,000 or so iterations run fine, in a few minutes. Somewhere around there, the GC starts to tear me a new one. I incompetently played with different settings for the heap sizes, but I don't really know what I'm doing. When I set the GC output to verbose, I see the following type of output when it slows down: $<>allocated_words = 77096 extra_heap_resources = 0u amount of work to do = 1240u ordered work = 0 words computed work = 520396 words Sweeping 520396 words $<>allocated_words = 74450 extra_heap_resources = 0u amount of work to do = 1198u ordered work = 0 words computed work = 502536 words Sweeping 502536 words $<>allocated_words = 71702 extra_heap_resources = 0u amount of work to do = 1153u ordered work = 0 words computed work = 483988 words Sweeping 483988 words $<>allocated_words = 68841 extra_heap_resources = 0u amount of work to do = 1107u ordered work = 0 words computed work = 464676 words Sweeping 464676 words ... These messages continue to occur so frequently that I think the GC is doing much more work than the program itself. The loop is doing some reasonable (I think) operations on these lists - filter, fold_left, rev_append, rev_map, iter, and so forth. Each iteration uses Printf to print a line to stdout. There are probably a couple hundred megs of static data set (not being allocated or deallocated) also present in memory, and being used by the loop. Anyway, let me know if you have any ideas. Mike