From: Randy MacLeod <randy.macleod@windriver.com>
To: yocto@lists.yoctoproject.org, luis.merayo@ridgerun.com
Subject: Re: [yocto] Limiting Yocto Memory Usage
Date: Tue, 14 Jul 2026 17:33:04 -0400 [thread overview]
Message-ID: <2be84a80-e227-40cd-b63d-781dab0d9fb1@windriver.com> (raw)
In-Reply-To: <CAPGGCfrQqFjk68=6_JXCrj3XyxK1inZUNzjx4JZikm0MfhfQFg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2847 bytes --]
Hi Luis,
On 2026-07-10 17:26, Luis Merayo via 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?
Not without using a container to do the build.
>
> Could these three variables achieve this?
>
> BB_PRESSURE_MAX_CPU
> <https://docs.yoctoproject.org/dev/ref-manual/variables.html#term-BB_PRESSURE_MAX_CPU>,
> BB_PRESSURE_MAX_IO
> <https://docs.yoctoproject.org/dev/ref-manual/variables.html#term-BB_PRESSURE_MAX_IO> ,
> BB_PRESSURE_MAX_MEMORY
> <https://docs.yoctoproject.org/dev/ref-manual/variables.html#term-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.
No, there is only pressure when resources are over-commited so if you
have free memory, there's no over-commit.
https://docs.kernel.org/accounting/psi.html
That's the design intent of the bitbake PRESSURE regulation system.
There are plans to work on additional build system regulation.
The first idea is to use the jobserver design:
https://lore.kernel.org/openembedded-core/?q=GNU+AND+jobserver++AND+f%3Amacleod
and that would indirectly limit memory consumption since there would be
fewer instances of gcc / rustc / ... running
at once.
There's also an even less clear idea about being able to restrict the
build by specifying memory usage.
That shouldn't be too hard to implement in bitbake in the same point
where the pressure checks happen.
Are you interested in working on that ?
There are of course other levers to pull to reduce CPU/memory consumption:
https://docs.yoctoproject.org/dev-manual/limiting-resources.html
Have you tried them ?
>
> Regards,
>
> Luis
>
>
>
> File:RidgeRun.ai banner.png <https://ridgerun.ai/>
> 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 (#66637):https://lists.yoctoproject.org/g/yocto/message/66637
> Mute This Topic:https://lists.yoctoproject.org/mt/120213825/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: 8837 bytes --]
prev parent reply other threads:[~2026-07-14 21:33 UTC|newest]
Thread overview: 2+ 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 ` Randy MacLeod [this message]
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=2be84a80-e227-40cd-b63d-781dab0d9fb1@windriver.com \
--to=randy.macleod@windriver.com \
--cc=luis.merayo@ridgerun.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.