From owner-freebsd-hackers@FreeBSD.ORG Thu May 22 13:38:19 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F7B11065671 for ; Thu, 22 May 2008 13:38:19 +0000 (UTC) (envelope-from jdc@parodius.com) Received: from mx01.sc1.parodius.com (mx01.sc1.parodius.com [72.20.106.3]) by mx1.freebsd.org (Postfix) with ESMTP id 68D738FC17 for ; Thu, 22 May 2008 13:38:19 +0000 (UTC) (envelope-from jdc@parodius.com) Received: by mx01.sc1.parodius.com (Postfix, from userid 1000) id 547F31CC033; Thu, 22 May 2008 06:38:19 -0700 (PDT) Date: Thu, 22 May 2008 06:38:19 -0700 From: Jeremy Chadwick To: Adrian Thearle Message-ID: <20080522133819.GA45578@eos.sc1.parodius.com> References: <48356E75.1050105@thearle.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48356E75.1050105@thearle.com.au> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-hackers@freebsd.org Subject: Re: Maximum memory allocation per process X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2008 13:38:19 -0000 On Thu, May 22, 2008 at 11:00:37PM +1000, Adrian Thearle wrote: > I have a problem with a perl script running out of memory. From my googling > I have found that perl itself does not seem to impose any memory limits, > and I have check ulimit and login.conf for any userclass limitations but > found nothing that seems to be limiting my memory. > > I have 128MBytes of RAM and a 2Gbyte swap partition. > > I am currently running > FreeBSD albert 6.2-STABLE FreeBSD 6.2-STABLE #11: Sun Sep 2 00:45:05 EST > 2007 > which I guess isn't exactly the latest... but the same thing happens on my > REL7.0 Box > > The process (imapsync in this case) runs out of ram at pretty much 512MB. I > read on a forum that BSD 6 imposes such a limit of 512MB per process, but i > have found no where to tune this, or even see what it is. You need to modify some kernel settings via /boot/loader.conf and reboot. Here's what we use on our production RELENG_6 and RELENG_7 boxes: # Increase maximum allocatable memory on a process to 2GB. # (We don't choose 3GB (our max RAM) since that would # exhaust all memory, and result in a kernel panic.) # Set default memory size as 768MB. # Maximum stack size is 256MB. # kern.maxdsiz="2048M" kern.dfldsiz="768M" kern.maxssiz="256MB" > I have also read that there are two sysctl namely, kern.maxdsiz and > kern.maxssiz, that can tune memory allocation but what happend to them in > Freebsd 6. These are not sysctls, they are kernel settings. They exist on both RELENG_6 and RELENG_7. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |