Home / Companies / Aspect Build / Blog / Post Details
Content Deep Dive

Fixing Bazel out-of-memory problems

Blog post from Aspect Build

Post Details
Company
Date Published
Author
Alex Eagle
Word Count
716
Language
English
Hacker News Points
-
Summary

Memory management poses significant challenges in cloud-hosted build systems, particularly when using Bazel, a build tool that can encounter two main memory issues: the Bazel server's JVM exceeding its heap size and the system running out of memory due to subprocess actions consuming resources. The Bazel server might exit with code 33 if it runs out of memory, a situation that can be mitigated by adjusting JVM parameters or using memory profiling tools to identify excessive memory consumption. Additionally, concurrent actions scheduled by Bazel can deplete system memory, especially if Bazel misjudges available resources or the memory needs of each action. Remedies include adjusting the --local_ram_resources flag to align with container limits, reducing concurrency with the --jobs flag, and utilizing attributes like test_size to allocate adequate resources for specific tasks. Remote Build Execution offers an alternative by offloading intensive tasks to a cloud environment, potentially alleviating local resource constraints.