From nobody Wed Oct 25 08:17:03 2023 X-Original-To: freebsd-ports@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SFhc25vZ1z4yBmr for ; Wed, 25 Oct 2023 08:17:06 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SFhc242W6z3F3m for ; Wed, 25 Oct 2023 08:17:06 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4003a.ext.cloudfilter.net ([10.228.9.183]) by cmsmtp with ESMTPS id vYsCqKH3Z8jpTvZ4bqh74C; Wed, 25 Oct 2023 08:17:05 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id vZ4ZqOi4rMsNfvZ4aqYhpl; Wed, 25 Oct 2023 08:17:05 +0000 X-Authority-Analysis: v=2.4 cv=KJNJsXJo c=1 sm=1 tr=0 ts=6538cf01 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=bhdUkHdE2iEA:10 a=C6EfLM-sAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=c3cEH2xTyY1yEMiOxUwA:9 a=QEXdDO2ut3YA:10 a=-LOoIXv5KNPoUydsO0ce:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 96A056F1; Wed, 25 Oct 2023 01:17:03 -0700 (PDT) Received: from slippy (localhost [IPv6:::1]) by slippy.cwsent.com (Postfix) with ESMTP id 8087D191; Wed, 25 Oct 2023 01:17:03 -0700 (PDT) Date: Wed, 25 Oct 2023 01:17:03 -0700 From: Cy Schubert To: Xavier Humbert Cc: FreeBSD Ports ML Subject: Re: Rust build huge memory consumption Message-ID: <20231025011703.2480bd16@slippy> In-Reply-To: <1c494f89-0023-46af-8200-58e621603c33@groumpf.org> References: <09a4bfb8-ba61-4e05-b646-973104337f77@groumpf.org> <20231025064626.A5DA6168@slippy.cwsent.com> <5816a79c-9bd0-4c41-9520-eed853aa15a4@groumpf.org> <20231025070129.E565C16A@slippy.cwsent.com> <1c494f89-0023-46af-8200-58e621603c33@groumpf.org> Organization: KOMQUATS X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; amd64-portbld-freebsd15.0) List-Id: Porting software to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-ports List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-CMAE-Envelope: MS4xfJv84gGuTCGAI52D8umiWiQzS1XNfiz1w2X9EwLMi3DWgXmXw0Jm9ro0iVGP2cFW8ytDTVU1327DJ3YRfHRSmjrWqjcQxXPEPcq8d9WJZ2uT7Le/VsXQ rtEO+/R3+dEJ43tE8VzU/TTEBGRL7ZkS1u0dzYsTSAGt5AyxTr5v32U9WgUWKHmPf5ngaToYFOvhJFjhiWZCQdeQISEZwjZoOf5nMSKRTa5jCMtxgCyEo2aW H11TTqyeWsr+iioBF13ReQ== X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Queue-Id: 4SFhc242W6z3F3m On Wed, 25 Oct 2023 09:03:48 +0200 Xavier Humbert wrote: > Le 10/25/23 09:01, Cy Schubert a =C3=A9crit : > > In message<5816a79c-9bd0-4c41-9520-eed853aa15a4@groumpf.org>, Xavier > > Humbert w > > rites: =20 > >> Le 10/25/23 08:46, Cy Schubert a =C3=83=C2=A9crit : =20 > >>> In message<09a4bfb8-ba61-4e05-b646-973104337f77@groumpf.org>, Xavier > >>> Humbert w > >>> rites: =20 > >>>> Hi, > >>>> > >>>> When building rust, all memory is eaten, leading to OOM killing almo= st > >>>> everything, eventually failing, and leading to an unstable system. > >>>> > >>>> Is there a way to tell the compiler to avoid this behaviour ? =20 > >>> How much RAM does your machine have? How many CPU cores/threads does = it > >>> have? > >>> =20 > >> I have 16 GB RAM, and 4 cores =20 > > That should be plenty. I build it on a 4 core 8 GB machine. > > > > How much swap does it have? > > > > Could this machine by chance be running a browser or other large apps at > > the same time? =20 >=20 > It has 24GB swap, And I stop bhyve before building When the machine runs out of virtual memory -- that is RAM + swap -- while the kernel is trying to satisfy an app's memory allocation, it picks the largest process (Linux uses a "badness" score which IMO is inferior) and kills it. Try setting the sysctl vm.pfault_oom_attempts=3D-1. --=20 Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=3D0