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 OAA30249; Tue, 10 Sep 2002 14:43:25 +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 OAA30184 for ; Tue, 10 Sep 2002 14:43:24 +0200 (MET DST) Received: from shiva.jussieu.fr (shiva.jussieu.fr [134.157.0.129]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g8AChN903387 for ; Tue, 10 Sep 2002 14:43:23 +0200 (MET DST) Received: from mail.liafa.jussieu.fr (liafa1.liafa.jussieu.fr [132.227.81.128]) by shiva.jussieu.fr (8.12.5/jtpda-5.4) with ESMTP id g8AChNjR085244 for ; Tue, 10 Sep 2002 14:43:23 +0200 (CEST) X-Authentication-Warning: shiva.jussieu.fr: Host liafa1.liafa.jussieu.fr [132.227.81.128] claimed to be mail.liafa.jussieu.fr Received: from liafa0p.liafa.jussieu.fr (liafa0p.liafa.jussieu.fr [132.227.81.252]) by mail.liafa.jussieu.fr (8.9.3/jtpda-5.3.2) with ESMTP id OAA12717 for ; Tue, 10 Sep 2002 14:43:23 +0200 (MET DST) Received: from (durak@localhost) by liafa0p.liafa.jussieu.fr (8.11.6/jtpda-5.4) id g8AChMF16496 for caml-list@inria.fr; Tue, 10 Sep 2002 14:43:22 +0200 Date: Tue, 10 Sep 2002 14:43:22 +0200 From: Berke Durak To: caml-list@inria.fr Subject: [Caml-list] Native code and stack limit Message-ID: <20020910124322.GB12019@liafa.jussieu.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-Antivirus: scanned by sophie at shiva.jussieu.fr Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Some people in my lab complained of not being able to use Ocaml for depth-first exploring graphs with 1,000,000 or so nodes. Of course the usual remarks about tail recursion and stack limit have been raised. I decided to check these claims so I made a small program to depth-first search a random graph with about 80 bytes of intermediary data per node. Including stack space overhead for some function calls, I think the whole graph sould be explorable in less than 100 * n bytes stack space (rough guess). It seems that when compiling to native code, the run-time library ignores both the OCAMLRUNPARAM="l=256M" and Gc.set {(Gc.get()) with Gc.stack_limit = 64 * 1024 * 1024} instructions. The native-code program systematically aborts when its process size reaches 64M. I took a look at asmrun/gc_ctrl.c and the code for adjusting stack size is preprocessed-out. I also have no ulimits on my machine. Further, running the following code with OCAMLRUNPARAM="l=256M,v=8" let _ = Gc.set {(Gc.get()) with Gc.stack_limit = 64 * 1024 * 1024} prints an Initial stack limit: 1024k bytes Changing stack limit to 262144k bytes only if compiled to byte code. Is there a problem here ? Am I missing something ? I've searched the mailing list and the frequently asked questions. There's nothing about Stack_overflow with native code. Thanks for your help. -- Berke Durak ------------------- 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