From: Randy MacLeod <randy.macleod@windriver.com>
To: yocto@lists.yoctoproject.org, u.oelmann@pengutronix.de,
luis.merayo@ridgerun.com
Subject: Re: [yocto] Limiting Yocto Memory Usage
Date: Tue, 21 Jul 2026 11:22:31 -0400 [thread overview]
Message-ID: <f7c74a04-f5dc-4e09-8bae-65626db09dde@windriver.com> (raw)
In-Reply-To: <6rpl0nny24.fsf@pengutronix.de>
[-- Attachment #1: Type: text/plain, Size: 2799 bytes --]
On 2026-07-16 04:22, Ulrich Ölmann via lists.yoctoproject.org wrote:
> Hey Luis,
>
> On Fri, Jul 10 2026 at 15:26 -0600, "Luis Merayo via lists.yoctoproject.org"<luis.merayo=ridgerun.com@lists.yoctoproject.org> wrote:
>> Hi,
>>
>> I would like to know if there is a way to limit Bitbake's Memory usage
>> to a specific percentage of the available RAM. For example, can the
>> Yocto build be limited to use a maximum of 70% of RAM?
> if you are doing your Bitbake work on a machine running a systemd based
> Linux distribution you could simply do something like
>
> $ systemd-run \
> --user \
> --scope \
> --property=CPUWeight=<YOUR_CPUWEIGHT> \
> --property=IOWeight=<YOUR_IOWEIGHT> \
> --property=MemoryHigh=<YOUR_MEMORYHIGH> \
> --property=OOMPolicy=kill \
> --unit="bitbake-run" \
> bitbake [...]
>
> to somewhat limit the resources, see systemd.resource-control(5) and
> systemd.scope(5) for details regarding the used parameters.
>
> Best regards,
> Ulrich
Hi Ulrich,
Using systemd-run is something that I've been meaning to try so it's
good to hear that you're doing it.
Do you have any experiences to share about this approach ?
Do you do world builds?
Do you run more than one systemd-run build on a given machine?
Of course it doesn't prevent bitbake from pushing the cgroup contained
system
harder that it can handle and bitbake doesn't have any feedback so
that's something
to consider when doing the jobserver or free memory build regulation work.
../Randy
>
>
>> Could these three variables achieve this?
>>
>> BB_PRESSURE_MAX_CPU, BB_PRESSURE_MAX_IO , BB_PRESSURE_MAX_MEMORY
>>
>> I see the range for these variables is from 1 to 1000000, so I would
>> like to understand if there is a way to specify their values as a
>> function of the available RAM.
>>
>> Regards,
>>
>> Luis
>>
>>
>> This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential
>> information that may be proprietary, privileged, or copyrighted under applicable law. If you are not the intended
>> recipient, do not read, copy, or forward this email message or any attachments, delete this email message and any
>> attachments immediately.
>>
>>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#66645):https://lists.yoctoproject.org/g/yocto/message/66645
>> Mute This Topic:https://lists.yoctoproject.org/mt/120272854/3616765
>> Group Owner:yocto+owner@lists.yoctoproject.org
>> Unsubscribe:https://lists.yoctoproject.org/g/yocto/unsub [randy.macleod@windriver.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
--
# Randy MacLeod
# Wind River Linux
[-- Attachment #2: Type: text/html, Size: 4403 bytes --]
next prev parent reply other threads:[~2026-07-21 15:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-10 21:26 Limiting Yocto Memory Usage Luis Merayo
2026-07-14 21:33 ` [yocto] " Randy MacLeod
2026-07-28 7:30 ` Ferry Toth
2026-07-28 20:35 ` Ferry Toth
2026-07-28 21:20 ` Randy MacLeod
2026-07-28 21:36 ` Ferry Toth
2026-07-29 21:30 ` Randy MacLeod
2026-07-16 8:22 ` Ulrich Ölmann
2026-07-21 15:22 ` Randy MacLeod [this message]
2026-07-22 6:23 ` Nate Kent
2026-07-22 8:00 ` Ulrich Ölmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f7c74a04-f5dc-4e09-8bae-65626db09dde@windriver.com \
--to=randy.macleod@windriver.com \
--cc=luis.merayo@ridgerun.com \
--cc=u.oelmann@pengutronix.de \
--cc=yocto@lists.yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox