From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA18852 for caml-red; Sat, 30 Sep 2000 14:54:20 +0200 (MET DST) 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 AAA15021 for ; Sat, 30 Sep 2000 00:47:57 +0200 (MET DST) Received: from cepheus.azstarnet.com (cepheus.azstarnet.com [169.197.56.195]) by nez-perce.inria.fr (8.10.0/8.10.0) with ESMTP id e8TMluL24492 for ; Sat, 30 Sep 2000 00:47:56 +0200 (MET DST) Received: from dylan (dialup04ip011.tus.azstarnet.com [169.197.31.139]) by cepheus.azstarnet.com (8.9.3/8.9.3) with SMTP id PAA24180 for ; Fri, 29 Sep 2000 15:47:44 -0700 (MST) X-Sent-via: StarNet http://www.azstarnet.com/ Message-ID: <000501c02a67$c5307820$210148bf@dylan> From: "David McClain" To: Subject: Garbage collection in OCaml Date: Fri, 29 Sep 2000 15:50:45 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Sender: weis@pauillac.inria.fr Hi, I have a long running analysis program written in compiled OCaml (ocamlopt). If I let it run without interference it gradually allocates more and more memory until the system swap space is exhausted. At that point the program bombs off with an "out of memory" errror - probably generated by the OCaml array management routines. OTOH, I found by tinkering that placing a Gc.compact() in a periodically performed place, I manage to keep the entire system running within about 70 MBytes. (My machines all have 256 MB RAM or more). I have found that placing a Gc.full_major() does virtually nothing to prevent the exhaustion of memory, although it slows it down ever so slightly. The program was compiled to run with the default GC settings (whatever those are). That is to say, I did nothing to configure the GC system at program startup. Is this behavior normal? Must I plant strategic Gc.compact() in my code? I would have thought the GC would be more self monitoring. Your comments are most welcome, even if they are critical! Cheers, David McClain, Sr. Scientist Raytheon Missile Systems Co. Tucson, AZ