From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gproxy2-pub.mail.unifiedlayer.com (gproxy2-pub.mail.unifiedlayer.com [69.89.18.3]) by sourceware.org (Postfix) with ESMTPS id 3A1A138F857C for ; Fri, 10 Jun 2022 14:42:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3A1A138F857C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=mad-scientist.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mad-scientist.net Received: from cmgw10.mail.unifiedlayer.com (unknown [10.0.90.125]) by progateway4.mail.pro1.eigbox.com (Postfix) with ESMTP id 2242A1004835C for ; Fri, 10 Jun 2022 14:42:05 +0000 (UTC) Received: from box5922.bluehost.com ([162.241.30.80]) by cmsmtp with ESMTP id zfpsn9RZ60JMAzfpsnmAUW; Fri, 10 Jun 2022 14:42:05 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=cfsXElPM c=1 sm=1 tr=0 ts=62a3583d a=u+82WREdhvUKZ7QTvcqjvQ==:117 a=u+82WREdhvUKZ7QTvcqjvQ==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10:nop_charset_1 a=JPEYwPQDsx4A:10:nop_rcvd_month_year a=3EOfIcITIxQA:10:endurance_base64_authed_username_1 a=uiNNWzgbpUlRECRD3cIA:9 a=QEXdDO2ut3YA:10:nop_charset_2 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mad-scientist.us; s=default; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:Reply-To:From:Subject: Message-ID:Sender:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=9uiZufJLanhmeHYB5SoGz1iCBUaIuYlgSsHRGaU9vM8=; b=iKKHstc503YVsjSbbg1rKbLLPH 7s89raZxq38sdLoX//26KLsc2AMD0BSZgpl/UK5KRtJhPhshn7p+5fRLSXliqOyTO58+Q4bE4WSKY SnHoXC9WbzNfNN+pL/ECQ3Y0H; Received: from [160.231.0.90] (port=31917 helo=llin-psh13-dsa.dsone.3ds.com) by box5922.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1nzfps-001vvI-7f; Fri, 10 Jun 2022 08:42:04 -0600 Message-ID: <5dc1d2854640baba900b3889bd0d75bea7187d54.camel@mad-scientist.net> Subject: Re: Out of memory while building GCC 12.1.0 From: Paul Smith Reply-To: paul@mad-scientist.net To: Fiodar Stryzhniou Cc: gcc-help Date: Fri, 10 Jun 2022 10:42:03 -0400 In-Reply-To: References: <6af5f478-817e-ecdc-174f-cfd8dd6c0376@mail.ru> <996468e7556a34c30413aaa977e9f26688be8c93.camel@xry111.site> Organization: Please remain calm--I may be mad but I am a professional! Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.1 (by Flathub.org)) MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5922.bluehost.com X-AntiAbuse: Original Domain - gcc.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mad-scientist.net X-BWhitelist: no X-Source-IP: 160.231.0.90 X-Source-L: No X-Exim-ID: 1nzfps-001vvI-7f X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (llin-psh13-dsa.dsone.3ds.com) [160.231.0.90]:31917 X-Source-Auth: paul@mad-scientist.us X-Email-Count: 1 X-Source-Cap: bWFkc2NpZTE7bWFkc2NpZTE7Ym94NTkyMi5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=2.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, JMQ_SPF_NEUTRAL, KAM_NUMSUBJECT, RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2022 14:42:08 -0000 On Fri, 2022-06-10 at 15:29 +0300, Fiodar Stryzhniou wrote: > > If you don't set that variable it will try to compile every file at > > once. Either set the variable, or fix your script to use a sensible > > default like -j"${NUMBER_OF_PROCESSORS:-1}" >=20 > Looks like you right. Harcoded to -j6 helps. Another way to go is to add the "-l" option. This is often combined with "-j" (no limit) to have your build limited by load rather than by job count. So if you want the load on your system to be no greater than 2, you can say "-j -l2". Just to be aware, on Linux a load of "1" means approximately "1 CPU is 100% busy". So if you use "-l2" then you'll likely have between 2 and 3 jobs running, but if your jobs have to do a lot of waiting (say they need to do a lot of disk IO / your disk is slow) then you will have more running. Anyway, getting the best behavior out of parallelism is a matter of trial and error and is specific to your build environment. But plain "-j" with no other control is virtually never a good idea :).