From owner-freebsd-hackers@FreeBSD.ORG Sun Mar 25 16:18:25 2012 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52535106564A for ; Sun, 25 Mar 2012 16:18:25 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 42C158FC14 for ; Sun, 25 Mar 2012 16:18:24 +0000 (UTC) Received: by elvis.mu.org (Postfix, from userid 1192) id E04CB1A3C83; Sun, 25 Mar 2012 09:10:26 -0700 (PDT) Date: Sun, 25 Mar 2012 09:10:26 -0700 From: Alfred Perlstein To: hackers@freebsd.org Message-ID: <20120325161026.GA36229@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Cc: Subject: capping memory usage of buildworld (c++) 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: Sun, 25 Mar 2012 16:18:25 -0000 I have a few vms with "only" 768MB to 1GB of ram. The problem is that buildworld is slow unless I give make(1) a jobs arg of about 8. However now when it reaches the c++ part of the build, it starts to page like crazy: Mem: 495M Active, 47M Inact, 162M Wired, 20M Cache, 85M Buf, 1624K Free Swap: 2048M Total, 1527M Used, 521M Free, 74% Inuse, 4272K In, 280K Out PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND 44453 root 1 21 0 225M 71704K swread 1 2:14 2.98% cc1plus 44444 root 1 21 0 225M 68056K swread 1 2:18 1.95% cc1plus 44451 root 1 21 0 225M 72564K swread 0 2:17 1.95% cc1plus 44459 root 1 21 0 221M 66824K swread 1 2:13 1.95% cc1plus 44442 root 1 21 0 225M 67908K swread 1 2:12 1.95% cc1plus 44577 alfred 1 26 0 16716K 1812K CPU1 1 0:00 1.95% top 44446 root 1 21 0 225M 75148K swread 1 2:14 0.98% cc1plus 44440 root 1 21 0 225M 65184K swread 1 2:13 0.98% cc1plus 44435 root 1 21 0 225M 65084K swread 1 2:10 0.98% cc1plus Is there any way to cap the jobs when forking off c++? Would people be opposed to a hack where optionally one could fence off the jobs for C++ programs during buildworld? meaning maybe set .NOTPARALLEL via some other option? It's kind of insane how much memory the compiler uses these days. Any other options? -- - Alfred Perlstein .- VMOA #5191, 03 vmax, 92 gs500, 85 ch250, 07 zx10 .- FreeBSD committer