From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 8D9B3BBAF for ; Mon, 30 Nov 2009 22:52:41 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuUAANHNE0vUGyoBkWdsb2JhbACZGoJfAQEBAQkLCgcTA7w/hDEEgXI X-IronPort-AV: E=Sophos;i="4.47,316,1257116400"; d="asc'?scan'208";a="51271513" Received: from smtp1-g21.free.fr ([212.27.42.1]) by mail4-smtp-sop.national.inria.fr with ESMTP; 30 Nov 2009 22:52:33 +0100 Received: from smtp1-g21.free.fr (localhost [127.0.0.1]) by smtp1-g21.free.fr (Postfix) with ESMTP id CAF2894016A; Mon, 30 Nov 2009 22:52:27 +0100 (CET) Received: from macbookpro.local (unknown [78.240.16.62]) by smtp1-g21.free.fr (Postfix) with ESMTP id 83B929400FD; Mon, 30 Nov 2009 22:52:24 +0100 (CET) Message-ID: <4B143E93.6070702@univ-savoie.fr> Date: Mon, 30 Nov 2009 22:52:19 +0100 From: Christophe Raffalli User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: John Whitington Cc: OCaml Subject: Re: [Caml-list] Stack size on OS X References: <4B13E43E.2010602@univ-savoie.fr> <0B58D6B2-D154-4D52-9F93-3A0E000FAE37@coherentgraphics.co.uk> In-Reply-To: <0B58D6B2-D154-4D52-9F93-3A0E000FAE37@coherentgraphics.co.uk> X-Enigmail-Version: 0.96.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig117A05763BC41B016EA85030" X-Spam: no; 0.00; christophe:01 raffalli:01 christophe:01 raffalli:01 univ-savoie:01 ulimit:01 sig:01 ocaml:01 ocaml:01 deallocation:01 pointers:01 cheers:01 cheers:01 26,:98 100,000:98 X-Attachments: type="application/pgp-signature" name="signature.asc" name="signature.asc" This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig117A05763BC41B016EA85030 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable John Whitington a =E9crit : > Christophe, > > On 30 Nov 2009, at 15:26, Christophe Raffalli wrote: > =20 >> It seems that the problem of stack size is still not solved in OS X (l= imited to 8Mo by default and >> hard limit in the kernel to 64Mo with ulimit -s 64000). My unison is s= till crashing on >> very big changes ... >> >> However, I stumbled on this pdf >> >> http://www.google.fr/url?sa=3Dt&source=3Dweb&ct=3Dres&cd=3D1&ved=3D0CA= cQFjAA&url=3Dhttp%3A%2F%2Fhomepage.mac.com%2Feric.c%2Fhpc%2Fcontents%2Fdo= cumentation%2FHow%2520to%2520increase%2520the%2520stack%2520size%2520on%2= 520Mac%2520OS%2520X.pdf&ei=3Dv-MTS4aMG4Wj_AbFmok2&usg=3DAFQjCNH1qCjydtM1d= oAdtwtTJxaEAmwLSw&sig2=3Du9faAiBSuB7v-VzvHDPHRA) >> >> (This is the first hit on google with "increasing stack size on OS X")= >> >> which explain how to use -stack-addr and -stack-size in the gnu linker= to change the stack address >> and size. >> >> Did anyone try this on OS X for OCaml program ? >> >> I think stack limitation, for a functional program is not good and it = is even worse when the limit >> depends upon the platform. >> =20 > > You may find that a small number of changes to the source code can prev= ent excess stack usage - it may not be riddled through the whole program.= On an Intel macintosh, you can get the list of exceptions leading to the= stack overflow from OCaml, and work through them to find the source of t= he problem. > > =20 Yes, you can always use heap instead of stack, but stack allocation and deallocation is faster (but sometimes hard to tell how mush stack space a call cost, and some call can keep useless pointers accessible if you are not carefull, although quite rare in OCaml). > On first compiling my codebase (about 100,000 lines) on a machine with = limited stack size, it took only about a day to fix up. > > I agree that, morally, stack space available and general memory availab= le should be roughly equivalent concepts (like with Linux), but sometimes= it's easier to give in - after all, how are you to estimate the size you= actually need accurately? > =20 I do not understand what you mean ? stack size + heap size =3D maximum of= available memory as in linux is the best ? Cheers, Christophe > Cheers, > > =20 --------------enig117A05763BC41B016EA85030 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAksUPpcACgkQi9jr/RgYAS4quQCgqRmEJRjETqjeR6cSJ/wjLw5D bOkAnj7I70ZPyviEdpsIpuPBM716G+mB =GL/v -----END PGP SIGNATURE----- --------------enig117A05763BC41B016EA85030--