From owner-freebsd-questions@FreeBSD.ORG Fri May 14 01:47:57 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BBB6816A4CF for ; Fri, 14 May 2004 01:47:56 -0700 (PDT) Received: from zogbe.tasam.com (63-165-178-196.uterr.blacksburg.ntc-com.net [63.165.178.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id E5E8843D2D for ; Fri, 14 May 2004 01:47:55 -0700 (PDT) (envelope-from dot@fireduck.com) Received: from frigate (zogbe.tasam.com [10.95.95.5] (may be forged)) by zogbe.tasam.com (8.12.10/8.12.10) with SMTP id i4E8lt07003260 for ; Fri, 14 May 2004 04:47:55 -0400 (EDT) Message-ID: <000e01c43990$3bf36fe0$08695f0a@frigate> From: "Joseph Gleason" To: Date: Fri, 14 May 2004 04:48:31 -0400 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_000B_01C4396E.B4A64D80" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Subject: 64mb stack size limit? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 May 2004 08:47:57 -0000 This is a multi-part message in MIME format. ------=_NextPart_000_000B_01C4396E.B4A64D80 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Short question: Is there a way to increase the stack size limit for a user process beyond 64mb? Background: FreeBSD in question is 5.2.1-RELEASE. I am running an application (unison from /usr/ports/net/unison). This program by virtue to how it was developed (or possibly the language is uses, that being ocaml) uses a large amount of stack space when syncing large directory structures. With directory structures that contain on the order of 30,000 files, unison runs out of stack. Using the bash shell: ulimit reports a stack limit of 65536k: # ulimit -a core file size (blocks, -c) unlimited data seg size (kbytes, -d) 524288 file size (blocks, -f) unlimited max locked memory (kbytes, -l) unlimited max memory size (kbytes, -m) unlimited open files (-n) 11095 pipe size (512 bytes, -p) 1 stack size (kbytes, -s) 65536 cpu time (seconds, -t) unlimited max user processes (-u) 5547 virtual memory (kbytes, -v) unlimited Doing ulimit -s with a higher value does not seem to produce an error or change to this value. A little C++ program that I wrote to test stack limits confirms the 64mb limit, regardless of what I tell ulimit. Source is attached. ------=_NextPart_000_000B_01C4396E.B4A64D80 Content-Type: application/octet-stream; name="stack-test.cpp" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="stack-test.cpp" #include =0A= =0A= using namespace std;=0A= =0A= void r(int l)=0A= {=0A= unsigned char B[1048576];=0A= for(int i=3D0; i<1048576; i++) B[i]=3Di%256;=0A= =0A= cout << l+1 << "MB on stack." << endl;=0A= r(l+1);=0A= =0A= }=0A= =0A= int main()=0A= {=0A= r(0);=0A= }=0A= =0A= ------=_NextPart_000_000B_01C4396E.B4A64D80--