From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA30883; Tue, 13 Jul 2004 16:33:02 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 QAA31481 for ; Tue, 13 Jul 2004 16:33:01 +0200 (MET DST) Received: from yquem.inria.fr (yquem.inria.fr [128.93.8.37]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i6DEWxEV018068; Tue, 13 Jul 2004 16:32:59 +0200 Received: by yquem.inria.fr (Postfix, from userid 18180) id 9F010BBD8; Tue, 13 Jul 2004 16:32:59 +0200 (CEST) Date: Tue, 13 Jul 2004 16:32:59 +0200 From: Xavier Leroy To: Tom Hawkins Cc: caml-list@inria.fr Subject: Re: [Caml-list] Immediate Out_of_memory Message-ID: <20040713143259.GA22456@yquem.inria.fr> References: <200407130910.12206.tom@launchbird.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200407130910.12206.tom@launchbird.com> User-Agent: Mutt/1.3.28i X-Miltered: at nez-perce with ID 40F3F29B.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 hashtbl:01 cyclic:01 recursion:01 bounded:01 overflows:01 hypothesis:01 recursion:01 raises:01 exception:02 stack:02 stack:02 comparison:02 comparison:02 structural:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > After making a few minor changes, my program started raising the > Out_of_memory exception. The strange thing is it fires a split > second after the program starts. It happens so fast, 'top' doesn't > even have a chance to register it on its radar. > I narrowed it down to a 'Hashtbl.find' application. This is very likely due to a structural comparison (via =, like Hashtbl.find does) between cyclic structures. Structural comparison maintains a recursion stack that is bounded, and raises Out_of_memory when that stack overflows. With 3.08, you can confirm this hypothesis by running with OCAMLRUNPARAM set to 'v=63'; structural comparison will print a message if it runs out of recursion stack. - Xavier Leroy ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners