Knowledge Base:Emerge out of memory
- Building packages hit an "out of memory" error while emerge something
- The system became extremely slow because of swap usage while emerge something
Main idea is to decrease number of parallel compiler processes for some ebuilds.
Check current number of parallel jobs in MAKEOPTS:
portageq envvar MAKEOPTS
Also check EMERGE_DEFAULT_OPTS:
portageq envvar EMERGE_DEFAULT_OPTS
It is OK if EMERGE_DEFAULT_OPTS does not exist.
MAKEOPTS="-jN"is used with
EMERGE_DEFAULT_OPTS="--jobs K --load-average X.Y"the number of possible tasks created would be up to
N*K. Therefore, both variables need to be set with each other in mind as they create up to K jobs each with up to N tasks.
EMERGE_DEFAULT_OPTS cannot be set in /etc/portage/package.env. To override the defaults, specify new values on the command line instead.
Try to lower number of parallel jobs for some packages which usually requires more RAM to compile:
# dev-lang/rust need little more than 4GB RAM if MAKEOPTS="-j4" dev-lang/rust j2.conf # webkit-gtk needs more than 8GB RAM if MAKEOPTS="-j6" net-libs/webkit-gtk j2.conf # Firefox ESR needs more than 8GB RAM if jobs=6 www-client/firefox j2.conf # The Palemoon browser requires 9G minimum to build www-client/palemoon j1.conf # Need more than 8GB RAM if MAKEOPTS="-j6" mail-client/evolution j2.conf
Very low memory (single-board computers etc.)
It is not advised to use parallel jobs in either MAKEOPTS nor EMERGE_DEFAULT_OPTS on systems that are low RAM.
- Portage TMPDIR on tmpfs — another example: how to not use tmpfs for big packages (large packages list included)
- Knowledge Base:No space left on device while there is plenty of space available
- Add link here to the page /etc/portage/package.env.
--load-averagefor both MAKEOPTS and EMERGE_DEFAULT_OPTS?