1 |
On Thursday, 13 June 2019 12:59:41 BST Adam Carter wrote: |
2 |
> > You can use more swap (files) before buying more RAM. |
3 |
> |
4 |
> I have been doing this too. It only get used during the big builds. |
5 |
> |
6 |
> To create a 32G swap file and enable it (OP can do this now as the build |
7 |
> runs, to keep OOM away) |
8 |
> # fallocate -l 32G <swapfile> && chmod 600 <swapfile> && mkswap <swapfile> |
9 |
> && swapon <swapfile> |
10 |
> |
11 |
> use 'watch free -m' to see if its being used. Then after the build is over, |
12 |
> delete it/add it to fstab/whatever |
13 |
|
14 |
More swap will help, but the basic problem here is the HUGE number of jobs |
15 |
specified. If each job eats say up to 2G when it gets going, then -j32 will |
16 |
require >64G RAM to keep running without thrashing the swap device, or running |
17 |
OOM. |
18 |
|
19 |
The reasonable thing for big builds is to add an environment variable as |
20 |
already explained, which restricts the number of jobs. Or for an one off run |
21 |
something like: |
22 |
|
23 |
MAKEOPTS="-j8 -l7.8" emerge -1aNDv <package_name> |
24 |
|
25 |
On a i7 (4 cores x 2 threads) I use -j2 for huge compiles like chromium, |
26 |
because the PC only has 8G RAM. Smaller packages will emerge with -j12 |
27 |
without breaking into a sweat, although the optimum setting for this PC is "- |
28 |
j8 -l7.8". |
29 |
|
30 |
-- |
31 |
Regards, |
32 |
Mick |