User:Jens3/Compiling big packages

From Gentoo Wiki
Jump to:navigation Jump to:search
This page is obsolete, since there is Knowledge_Base:Emerge_out_of_memory

The Raspberry Pi 400 has 4GB RAM and 4 cores. To calculate how many threads should be possible use as a thumb of rule: about 1 thread per core but not more then RAM/2GB and at least one thread. The Pi400 has 4 cores but only (4 GB/2GB)=2 threads are recommended.

Using LTO may lead to a higher RAM usage.

Some programms need more RAM then 2GB per thread. A useful list of big programs can be found at Portage_TMPDIR_on_tmpfs, though that wiki site is for using more RAM to build with a tmp dir in RAM. If you compile packages which need much ram you can add -j1 on a per package base to use less ram.

I use the following configuration to compile some packages with just one thread:

FILE /etc/portage/package.envpackage.env example for -j1 per package
app-office/libreoffice  one-make-thread.conf
dev-db/mysql            one-make-thread.conf
dev-java/icedtea        one-make-thread.conf
dev-lang/ghc            one-make-thread.conf
dev-lang/mono           one-make-thread.conf
dev-lang/rust           one-make-thread.conf
dev-lang/spidermonkey   one-make-thread.conf
dev-qt/qtwebengine      one-make-thread.conf
mail-client/thunderbird one-make-thread.conf
sci-libs/tensorflow     one-make-thread.conf
sys-devel/gcc           one-make-thread.conf
www-client/chromium     one-make-thread.conf
www-client/firefox      one-make-thread.conf
FILE /etc/portage/env/one-make-thread.confone-make-thread.conf example for -j1 per package
MAKEOPTS="-j1"
NINJAFLAGS="-j1"