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
Bazel consumes too much memory and hangs in docker container #3645
Another sample, got a different behavior, instead of hanging it fails with an error:
ERROR: /root/.cache/bazel/_bazel_root/049ed6f058a98cba95753eee774cab7a/external/sassc/BUILD.bazel:4:1: C++ compilation of rule '@sassc//:sassc' failed (Exit 1)
external/libsass/src/sass.cpp:41:1: fatal error: error writing to /tmp/ccLTBo6L.s: Cannot allocate memory
}
^
compilation terminated.
The bug is not reproducible, so it is likely a hardware or OS problem.
changed the title [-]Bazel C++ compilation hangs in docker container[/-][+]Bazel consumes too much memory and hangs in docker container[/+]on Sep 23, 2017
We have no idea what's going on there, and I don't think we can debug this without seeing jvm.out. In order to get better debug information in the future, we will also need to add code to bazel client to cat jvm.out.
I think I opened an issue a while back to add documentation on “what should
you report” when seeing serious bazel issues (I think I was talking about
reproducibility).
Hi there! We're doing a clean up of old issues and will be closing this one. Please reopen (or ping me to reopen) if you’d like to discuss anything further. We’ll respond as soon as we have the bandwidth/resources to do so.
The memory usage in general is hard to control - Bazel needs to hold your build graph in memory. The amount of parallel actions can be controlled with --jobs, e.g. --jobs=HOST_RAM*0.01, together with --local_ram_resources.
Activity
alexeagle commentedon Aug 30, 2017
Confirmed this also happens on release 0.5.4
alexeagle commentedon Aug 30, 2017
Another sample, got a different behavior, instead of hanging it fails with an error:
alexeagle commentedon Sep 10, 2017
Hi, this prevents Angular bazel apps from using CircleCI, which is our recommendation.
It also means the canonical demo app
https://github.com/alexeagle/angular-bazel-example
has a flaky build status, which looks bad.
Can someone triage this? I might be able to fix it if I could tell what is wrong.
/cc @davidstanke
alexeagle commentedon Sep 22, 2017
Ping!
alexeagle commentedon Sep 23, 2017
@gregmagolan tracked it down (thanks!)
Under the docker container, the amount of memory available to a process is limited
https://docs.docker.com/engine/admin/resource_constraints/
Bazel should determine the amount of available RAM (you hint at this in https://docs.bazel.build/versions/master/user-manual.html#flag--ram_utilization_factor )
but that doesn't account for the
cgrouplimitation.https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
(Edited by @laszlocsomor on 2018/06/14: fix broken URL)
Workaround bazelbuild/bazel#3645
[-]Bazel C++ compilation hangs in docker container[/-][+]Bazel consumes too much memory and hangs in docker container[/+]djudd-stripe commentedon Nov 29, 2017
Underlying issues might be #3886 plus #2946?
laszlocsomor commentedon Jun 14, 2018
/cc: @jhfield @ulfjack @ericfelly
Summary: #3645 (comment)
Who should work on this?
ulfjack commentedon Jun 14, 2018
We have no idea what's going on there, and I don't think we can debug this without seeing jvm.out. In order to get better debug information in the future, we will also need to add code to bazel client to cat jvm.out.
ulfjack commentedon Jun 14, 2018
This isn't the first time that not having jvm.out is preventing us from making progress.
ittaiz commentedon Jun 14, 2018
9 remaining items
sgowroji commentedon Feb 17, 2023
Hi there! We're doing a clean up of old issues and will be closing this one. Please reopen (or ping me to reopen) if you’d like to discuss anything further. We’ll respond as soon as we have the bandwidth/resources to do so.
fmeum commentedon Feb 17, 2023
@sgowroji Not stale, has a Bazel team assignee.
larsrc-google commentedon Apr 26, 2023
I think #16512 does fix this.
fmeum commentedon Apr 26, 2023
@larsrc-google Please reopen, my fix only applied to CPU shares, not RAM.
larsrc-google commentedon Apr 28, 2023
The memory usage in general is hard to control - Bazel needs to hold your build graph in memory. The amount of parallel actions can be controlled with
--jobs, e.g.--jobs=HOST_RAM*0.01, together with--local_ram_resources.