On Thursday, 13 June 2019 12:59:41 BST Adam Carter wrote:
> > You can use more swap (files) before buying more RAM.
> 
> I have been doing this too. It only get used during the big builds.
> 
> To create a 32G swap file and enable it (OP can do this now as the build
> runs, to keep OOM away)
> # fallocate -l 32G <swapfile> && chmod 600 <swapfile> && mkswap <swapfile>
> && swapon <swapfile>
> 
> use 'watch free -m' to see if its being used. Then after the build is over,
> delete it/add it to fstab/whatever

More swap will help, but the basic problem here is the HUGE number of jobs 
specified.  If each job eats say up to 2G when it gets going, then -j32 will 
require >64G RAM to keep running without thrashing the swap device, or running 
OOM.

The reasonable thing for big builds is to add an environment variable as 
already explained, which restricts the number of jobs.  Or for an one off run 
something like:

MAKEOPTS="-j8 -l7.8" emerge -1aNDv <package_name>

On a i7 (4 cores x 2 threads) I use -j2 for huge compiles like chromium, 
because the PC only has 8G RAM.  Smaller packages will emerge with -j12 
without breaking into a sweat, although the optimum setting for this PC is "-
j8 -l7.8".

-- 
Regards,
Mick

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to