You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ability to override RAM estimate for cppcompile action #25770
Currently our bazel build crashes on most machines due to an inaccurate RAM estimation: our .cpp compiles take 2-4 GB of RAM so will crash on machines where the available RAM/CPU count is less than that.
Currently there doesn't seem to be a way to override the estimate:
for this action, though resource_set is available to do this for some other actions. It is also not clear what "inputs" is in the context of cppcompile actions (this probably makes more sense for links).
Which category does this issue belong to?
No response
What underlying problem are you trying to solve with this feature?
No crashing on parallel builds where each compile job uses a lot of RAM.
Which operating system are you running Bazel on?
Linux
What is the output of bazel info release?
release 7.5.0
If bazel info release returns development version or (@non-git), tell us how you built Bazel.
n/a
What's the output of git remote get-url origin; git rev-parse HEAD ?
For which repo?
Have you found anything relevant by searching the web?
Yes. It seems like this functionality is not available currently for native jobs, though things like resources:memory tag can work for some other jobs.
Any other information, logs, or outputs that you want to share?
does using tags = ["resources:memory:N"] work for you?
No, I tried adding resources:memory:10000m to the cc_library invocations but there was no different in behavior (32 compile jobs were started on my 32-CPU host with 96 GB of RAM, while if it was working I'd expect at most 9).
#29284 would let you override this on a per-platform / per target basis, but still only statically. I also submitted #29283 which would allow you to target those resource constraints more granularly
Activity
rockwotj commentedon Apr 4, 2025
Note this isn't used unless you specify an undocumented flag, by default it's 250MiB and 1 CPU.
keith commentedon Apr 4, 2025
does using
tags = ["resources:memory:N"]work for you?rockwotj commentedon Apr 4, 2025
@keith I believe that only works for tests, at least in the compile action I don't see code for that tag handling
benjaminp commentedon Apr 4, 2025
related saga: #17368
travisdowns commentedon Apr 7, 2025
Indeed it's related, but I though it's worth having another one for cppcompile as:
travisdowns commentedon Apr 7, 2025
No, I tried adding
resources:memory:10000mto thecc_libraryinvocations but there was no different in behavior (32 compile jobs were started on my 32-CPU host with 96 GB of RAM, while if it was working I'd expect at most 9).keith commentedon Apr 13, 2026
#29284 would let you override this on a per-platform / per target basis, but still only statically. I also submitted #29283 which would allow you to target those resource constraints more granularly
Make local scheduling respect exec_properties resources (#29284)
[9.2.0] Make local scheduling respect exec_properties resources (baze…