bazel: Blaze ran out of memory and crashed.

Hello,

Iโ€™m trying to build bazel from source on a farm server running CentOS-5.7. I donโ€™t have root access on this machine. My libc version 2.5. Here are the steps I take:

$) git clone https://github.com/bazelbuild/bazel.git
$) export PATH=/home/utils/gcc-4.8.4/bin:$PATH 
$) export LD_LIBRARY_PATH=/home/utils/gcc-4.8.4/lib64:$LD_LIBRARY_PATH 
$) export JAVA_HOME=/home/utils/java/jdk1.8.0_51/
$) ./compile.sh

Here is the output I observe:

INFO: You can skip this first step by providing a path to the bazel binary as second argument:
INFO:    ./compile.sh compile /path/to/bazel
๐Ÿƒ  Building Bazel from scratch......
๐Ÿƒ  Building Bazel with Bazel.
.INFO: Elapsed time: 0.667s
unable to create new native thread

Blaze ran out of memory and crashed.

Building output/bazel

Iโ€™d appreciate any suggestions on how to fix this or how to dump out more information about this crash.

My eventual goal is is build TensorFlow from source using bazel.

Thank you!

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 27 (12 by maintainers)

Most upvoted comments

It worked for me by setting --jobs 10 and --ram_utilization_factor 25. Basically i am trying to build the tensorflow python pip package from source, so the command now becomes,

bazel build --jobs 10 --ram_utilization_factor 25 -c opt //tensorflow/tools/pip_package:build_pip_package

I think this is happening cause of the poor specs of the machine.

@snazzman how did you solve the memory issue finally? I do ~$ export EXTRA_BAZEL_ARGS=โ€˜โ€“jobs 1โ€™ ~$ ./compile.sh and it still gives me: unable to create new native thread

Blaze ran out of memory and crashed.

Solved by: ulimit -u 100000 (in bash shell)

I am so upset about this threads. ghost asked the question about Building Bazel tool from source and had out of memory issue. Lots of people answered the solution to fix out of memory when using Bazel โ€” not Building Bazel.