From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 9 18:13:52 2012 Return-Path: Delivered-To: hackers@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 664) id 50EAC5CD; Fri, 9 Nov 2012 18:13:52 +0000 (UTC) Date: Fri, 9 Nov 2012 10:13:51 -0800 From: David O'Brien To: Alfred Perlstein Subject: Re: make -jN buildworld on < 512MB ram Message-ID: <20121109181351.GE9916@dragon.NUXI.org> Mail-Followup-To: obrien@freebsd.org, Alfred Perlstein , hackers@freebsd.org References: <509182DA.8070303@mu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <509182DA.8070303@mu.org> X-Operating-System: FreeBSD 10.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.20 (2009-06-14) Cc: hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: obrien@freebsd.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2012 18:13:52 -0000 On Wed, Oct 31, 2012 at 12:58:18PM -0700, Alfred Perlstein wrote: > It seems like the new compiler likes to get up to ~200+MB resident when > building some basic things in our tree. > Unfortunately this causes smaller machines (VMs) to take days because of > swap thrashing. You could try reducing data seg size (ulimit -d) to something matching "RAM" size. GCC has two parameters to try to keep its memory usage "reasonable": http://gcc.gnu.org/onlinedocs/gcc-4.2.4/gcc/Optimize-Options.html 'ggc-min-expand' and 'ggc-min-heapsize'. ggc-min-expand ... If getrlimit is available, the notion of "RAM" is the smallest of actual RAM and RLIMIT_DATA ggc-min-heapsize The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded I don't know if Clang/LLVM has something similar or not. -- -- David (obrien@FreeBSD.org)