Gentoo Archives: gentoo-dev

From: Florian Schmaus <flow@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH] check-reqs.eclass: clamp MAKEOPTS for memory/RAM usage
Date: Wed, 05 Jan 2022 16:17:54
Message-Id: 8428b396-5b3f-4ca8-52e2-05ab0f2113a3@gentoo.org
In Reply to: Re: [gentoo-dev] [PATCH] check-reqs.eclass: clamp MAKEOPTS for memory/RAM usage by Ulrich Mueller
1 On 05/01/2022 09.28, Ulrich Mueller wrote:
2 >>>>>> On Tue, 04 Jan 2022, Sam James wrote:
3 >> Crank down MAKEOPTS jobs if MAKEOPTS="-jN" is too high for the
4 >> amount of RAM available (uses amount declared as needed
5 >> in the ebuild). Typically should be ~2GB per job.
6 >
7 > Where does this number 2 GB come from? The amount of RAM strongly
8 > depends on the programming language and other factors, so I don't
9 > believe that there's one number that can be used for everything.
10
11 Surely not, but 2 GiB seems like a good start. I guess it could become
12 an eclass variable that ebuilds could modify later (if the need emerges).
13
14
15 >> +# @ECLASS-VARIABLE: CHECKREQS_MEMORY_MANGLE_JOBS
16 >> +# @USER_VARIABLE
17 >> +# @DESCRIPTION:
18 >> +# Allow packages to reduce the number of multiprocessing (e.g. make, ninja) jobs
19 >> +# to lower memory usage.
20 >> +: ${CHECKREQS_MEMORY_MANGLE_JOBS=yes}
21 >
22 > If anything, the feature should be opt-in rather than opt-out.
23
24 It appears to me that the motivation for this change is to prevent users
25 from running into OOM situations when emerging a package. And I believe
26 that many users, especially novices, are not directly able to determine
27 that portage failed due to OOM, simply because there is no direct hint
28 in the build log. Hence opt-out appears to be sensible to me here.
29
30 - Flow

Replies