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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 3EA3CBBAF for ; Mon, 30 Nov 2009 17:07:42 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: An4CADd8E0vD2MUqmWdsb2JhbACcBgEBAQEBCAsKBxO8M4QxBIFy X-IronPort-AV: E=Sophos;i="4.47,314,1257116400"; d="scan'208";a="41095807" Received: from bluelynx4.ukhost4u.com ([195.216.197.42]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 30 Nov 2009 17:07:41 +0100 Received: from [78.105.203.81] (helo=muscat.lan) by bluelynx4.ukhost4u.com with esmtpa (Exim 4.69) (envelope-from ) id 1NF8mo-0007wd-5k; Mon, 30 Nov 2009 16:07:38 +0000 Subject: Re: [Caml-list] Stack size on OS X Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: John Whitington In-Reply-To: <4B13E43E.2010602@univ-savoie.fr> Date: Mon, 30 Nov 2009 16:07:35 +0000 Cc: caml-list@inria.fr Content-Transfer-Encoding: quoted-printable Message-Id: <0B58D6B2-D154-4D52-9F93-3A0E000FAE37@coherentgraphics.co.uk> References: <4B13E43E.2010602@univ-savoie.fr> To: Christophe Raffalli X-Mailer: Apple Mail (2.1077) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bluelynx4.ukhost4u.com X-AntiAbuse: Original Domain - inria.fr X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - coherentgraphics.co.uk X-Source: X-Source-Args: X-Source-Dir: X-Spam: no; 0.00; christophe:01 christophe:01 raffalli:01 ulimit:01 sig:01 ocaml:01 ocaml:01 cheers:01 26,:98 100,000:98 wrote:01 stack:01 stack:01 caml-list:01 exceptions:01 Christophe, On 30 Nov 2009, at 15:26, Christophe Raffalli wrote: > It seems that the problem of stack size is still not solved in OS X = (limited to 8Mo by default and > hard limit in the kernel to 64Mo with ulimit -s 64000). My unison is = still crashing on > very big changes ... >=20 > However, I stumbled on this pdf >=20 > = http://www.google.fr/url?sa=3Dt&source=3Dweb&ct=3Dres&cd=3D1&ved=3D0CAcQFj= AA&url=3Dhttp%3A%2F%2Fhomepage.mac.com%2Feric.c%2Fhpc%2Fcontents%2Fdocumen= tation%2FHow%2520to%2520increase%2520the%2520stack%2520size%2520on%2520Mac= %2520OS%2520X.pdf&ei=3Dv-MTS4aMG4Wj_AbFmok2&usg=3DAFQjCNH1qCjydtM1doAdtwtT= JxaEAmwLSw&sig2=3Du9faAiBSuB7v-VzvHDPHRA) >=20 > (This is the first hit on google with "increasing stack size on OS X") >=20 > which explain how to use -stack-addr and -stack-size in the gnu linker = to change the stack address > and size. >=20 > Did anyone try this on OS X for OCaml program ? >=20 > I think stack limitation, for a functional program is not good and it = is even worse when the limit > depends upon the platform. You may find that a small number of changes to the source code can = prevent 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 the problem. 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 = available 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? Cheers, --=20 John Whitington Director, Coherent Graphics Ltd http://www.coherentpdf.com/