'How to limit memory usage in yocto bitbake?

When building some packages, I found OOM in dmesg.

The build process was killed and terminated.

Anyway to set up memory usage limitations?



Solution 1:[1]

Easiest way for me is to specify the number of concurrent tasks running when building with

$ BB_NUMBER_THREADS=2 bitbake <target>

Where 2 is the number of concurrent build processes running.

You can also set this in your local.conf. Here's another answer on the topic.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 greezybacon