From owner-freebsd-questions Fri Mar 1 9:50:34 2002 Delivered-To: freebsd-questions@freebsd.org Received: from root.com (unknown [209.102.106.178]) by hub.freebsd.org (Postfix) with ESMTP id 510A437B41B for ; Fri, 1 Mar 2002 09:50:28 -0800 (PST) Received: (from dg@localhost) by root.com (8.11.2/8.11.2) id g21Hlxp36963; Fri, 1 Mar 2002 09:47:59 -0800 (PST) (envelope-from dg) Date: Fri, 1 Mar 2002 09:47:59 -0800 From: David Greenman To: Jason Barnes Cc: Erik Trulsson , freebsd-questions@freebsd.org Subject: Re: out of memory, but there's plenty left! Message-ID: <20020301094759.F35679@nexus.root.com> References: <20020301120312.GA32070@student.uu.se> <20020301055029.A11416-100000@c3po.lpl.arizona.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020301055029.A11416-100000@c3po.lpl.arizona.edu>; from jbarnes@c3po.lpl.arizona.edu on Fri, Mar 01, 2002 at 05:52:06AM -0700 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > >> > I'm running into a problem with my g++ code running out of memory >> > that might or might not be FreeBSD's fault. The program says, "out of >> > memory" and dumps core when it gets to about 512MB in size, but there is >> > plenty of RAM and swap space left. Here is the output from 'top' just >> > before it crashes: >> >> A single process is, by default, limited to a maximum of 512MB of data. >> It is almost certainly this limit you are running into. >> You can check the current limits with 'ulimit -a' >> To modify the limit you can recompile the kernel with MAXDSIZ set to >> the desired limit. Check LINT for details. > > I recompiled the kernel with these new lines: > >options MAXDSIZ="(2048*1024*1024)" >options MAXSSIZ="(2048*1024*1024)" >options DFLDSIZ="(2048*1024*1024)" > >and now everything works without any prolems! Awesome! Thank you very >much for your help! That was a bit overly aggressive and will almost certainly cause you problems. The kernel has to organize the process virtual address space, and there's only about 3GB available. The above tells the kernel that you want 2GB each for stack and data...which is not going to work like you want. -DG David Greenman Co-founder, The FreeBSD Project - http://www.freebsd.org President, TeraSolutions, Inc. - http://www.terasolutions.com President, Download Technologies, Inc. - http://www.downloadtech.com Pave the road of life with opportunities. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message