From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 51A51BB9C for ; Fri, 14 Oct 2005 11:32:29 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j9E9WS5Q005673 for ; Fri, 14 Oct 2005 11:32:29 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA13261 for ; Fri, 14 Oct 2005 11:32:28 +0200 (MET DST) Received: from furbychan.cocan.org (furbychan.cocan.org [80.68.91.176]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j9E9WQWP005642 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Fri, 14 Oct 2005 11:32:28 +0200 Received: from rich by furbychan.cocan.org with local (Exim 3.35 #1 (Debian)) id 1EQMCC-0002sW-00 for ; Fri, 14 Oct 2005 10:49:48 +0100 Date: Fri, 14 Oct 2005 10:49:48 +0100 To: caml-list@inria.fr Subject: Memory usage/ garbage collection question Message-ID: <20051014094948.GA11039@furbychan.cocan.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i From: Richard Jones X-Miltered: at nez-perce with ID 434F7B2C.003 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 434F7B2A.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; garbage:01 optimise:01 iteration:01 iteration:01 iter:01 stdlib:01 iter:01 garbage:01 iterated:01 notepad:01 elements:05 marketing:93 core:06 million:93 row:07 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 I'm trying to optimise a program which is using a large amount of memory and consequently thrashing. The core of the program is an iteration over a list of something like a million elements which consumes about 1/2 gig of RAM. The iteration is: List.iter ( fun row -> (* put row into database and forget about it *) ) rows; (* no further references to rows after this *) This is the stdlib implementation of List.iter. Should the garbage collector be able to collect the part of the list which has been iterated over, during the iteration? At the moment it doesn't look like it's doing so. Rich. -- Richard Jones, CTO Merjis Ltd. Merjis - web marketing and technology - http://merjis.com Team Notepad - intranets and extranets for business - http://team-notepad.com