From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id 0451A385627A for ; Fri, 10 Jun 2022 15:57:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0451A385627A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 25AFu931013000; Fri, 10 Jun 2022 10:56:09 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 25AFu8N6012999; Fri, 10 Jun 2022 10:56:08 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Fri, 10 Jun 2022 10:56:08 -0500 From: Segher Boessenkool To: Paul Smith Cc: Fiodar Stryzhniou , gcc-help Subject: Re: Out of memory while building GCC 12.1.0 Message-ID: <20220610155608.GS25951@gate.crashing.org> References: <6af5f478-817e-ecdc-174f-cfd8dd6c0376@mail.ru> <996468e7556a34c30413aaa977e9f26688be8c93.camel@xry111.site> <5dc1d2854640baba900b3889bd0d75bea7187d54.camel@mad-scientist.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5dc1d2854640baba900b3889bd0d75bea7187d54.camel@mad-scientist.net> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_NUMSUBJECT, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 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 15:57:11 -0000 On Fri, Jun 10, 2022 at 10:42:03AM -0400, Paul Smith wrote: > On Fri, 2022-06-10 at 15:29 +0300, Fiodar Stryzhniou wrote: > > 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". The load average is only computed every 5s, so if you have a faster machine it can bring your system to its knees in that time already, by starting thousands of tasks. Since maximum acceptable loadavg is very system specific as well, you can just always use -j instead, or -j -l. Just never use -j without number after it :-) Segher