caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Berke Durak <durak@liafa.jussieu.fr>
To: caml-list@inria.fr
Subject: [Caml-list] Native code and stack limit
Date: Tue, 10 Sep 2002 14:43:22 +0200	[thread overview]
Message-ID: <20020910124322.GB12019@liafa.jussieu.fr> (raw)

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


             reply	other threads:[~2002-09-10 12:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-10 12:43 Berke Durak [this message]
2002-09-10 14:34 ` Berke Durak
2002-09-10 16:11   ` M E Leypold @ labnet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020910124322.GB12019@liafa.jussieu.fr \
    --to=durak@liafa.jussieu.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).