Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Oct 2023 01:17:03 -0700
From:      Cy Schubert <Cy.Schubert@cschubert.com>
To:        Xavier Humbert <xavier@groumpf.org>
Cc:        FreeBSD Ports ML <freebsd-ports@freebsd.org>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 25 Oct 2023 09:03:48 +0200
Xavier Humbert <xavier@groumpf.org> 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 <Cy.Schubert@cschubert.com>
FreeBSD UNIX:  <cy@FreeBSD.org>   Web:  https://FreeBSD.org
NTP:           <cy@nwtime.org>    Web:  https://nwtime.org

			e^(i*pi)+1=3D0



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20231025011703.2480bd16>