Reduce Basel Memory Usage

I use bazel on a computer with 4 GB of RAM (to compile tensorflow project). However, Bazel does not take into account the amount of memory that I have, and generates too many jobs, causing my machine to change and lead to longer build times.

I already tried setting the ram_utilization_factor flag through the following lines in~/.bazelrc

build --ram_utilization_factor 30
test --ram_utilization_factor 30

but it did not help. How should all these factors be understood? Should I just randomly try out some others?

+4
source share
3 answers

Some other flags that may help:

  • --host_jvm_args , , JVM , -Xms / -Xmx, , bazel --host_jvm_args=-Xmx4g --host_jvm_args=-Xms512m build //foo:bar (docs).
  • --local_resources --ram_utilization_factor (docs).
  • --jobs=10 ( , 200), . bazel build --jobs=2 //foo:bar (docs).

, --host_jvm_args - , (build) --jobs "" , .

+7

--jobs @kristina :

bazel build --jobs=1 tensorflow:libtensorflow_all.so

: --jobs=1 , build, bazel . bazel --jobs=1 build tensorflow:libtensorflow_all.so, :

Unknown Bazel startup option: '--jobs=1'.
0

@sashoalm , --jobs=1 , bazel build .

, bazel Lubuntu 17.04, VirtualBox 1,5 Intel i3 ( Thinkpad T460). O'Reilly TensorFlow (https://www.oreilly.com/learning/dive-into-tensorflow-with-linux) :

$ bazel build tensorflow/examples/label_image:label_image

bazel build --jobs=1 tensorflow/... .

0

Source: https://habr.com/ru/post/1620990/


All Articles