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 QAA05641 for caml-red; Fri, 23 Jun 2000 16:15:47 +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 WAA20543 for ; Thu, 22 Jun 2000 22:17:18 +0200 (MET DST) Received: from fiji01.liquidmarket.com (oahu02.liquidmarket.com [208.244.147.130]) by nez-perce.inria.fr (8.10.0/8.10.0) with ESMTP id e5MKHGD09448 for ; Thu, 22 Jun 2000 22:17:17 +0200 (MET DST) Received: from liquidmarket.com (IDENT:mwall@maui07.liquidmarket.com [192.168.1.70]) by fiji01.liquidmarket.com (8.9.3/8.9.3) with ESMTP id MAA29254 for ; Thu, 22 Jun 2000 12:05:33 -0700 Message-ID: <395274C1.B37DCF95@liquidmarket.com> Date: Thu, 22 Jun 2000 13:19:13 -0700 From: Michael Wall X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.2.5-15 i686) X-Accept-Language: en MIME-Version: 1.0 To: caml-list@inria.fr Subject: memory problems Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: weis@pauillac.inria.fr hi everyone, i have an interesting problem i've run into a few times regarding memory leaks and reference passing. basically, if i pass a reference to a recursive binding i get a memory leak when i compile with the optimized compiler but if i compile with the bytecode compiler everything is ok. eg: in main: let maxI = ref 1000 in let vnew = COMPLEX_HOPFIELD.relax_neat (p, v, h, t, s, n, maxI) in in relax_neat: let rec relax_neat (p, v, h, t, s, n, maxI) = maxI:=!maxI -1; let pnew = runge_katta p h t s ({real = 1e-1; imag = 0.0}) n in let vnew = p_to_v pnew n in let hnew = to_h t vnew s n in let eps = COMPLEX_MATH.dis v vnew n in if !maxI > 0 && eps > 1.e-15 then (relax_neat (pnew, vnew, hnew, t, s, n, maxI)) else vnew i know its the reference be the optimized program ceases to leak when i remove it. forgive me if this is a known problem, i am new to caml and this group. anyones insight into this would be greatly appreciated, Regards, -- Mike Wall 310-225-2975 ext 156 mwall@liquidmarket.com