5

can not build with server terminated message.

2
  • 1
    What are the contents of the /home/elin/.cache/bazel/_bazel_elin/d60cb132a54ad1843b095cb9690d01e0/server/jvm.out file from the error message? That should have more information. Commented Jan 7, 2021 at 3:23
  • When this error is raised, that log file is empty. Commented Mar 5, 2021 at 17:22

1 Answer 1

9

The most common cause I've seen for this kind of thing (can't say for sure without the jvm.out) is running out of memory which results in the OOM killer terminating the bazel server process. Between the bazel server process and a bunch of C++ compilations in parallel, it's easy to run out. Using a lower --jobs is the most direct way to limit that. --local_ram_resources will help in theory, but bazel doesn't have a very good idea how much RAM each compilation command uses so it's very approximate.

Sign up to request clarification or add additional context in comments.

4 Comments

Really, So @Eileen_Lin if the problem was solved, accept @Brians' answer. I'm going to try the same approach. By the way --jobs only makes the process to be slow until the error is shown up again. But i'm going to follow the approach of cleaning the memory cache.
I just cleaned my cache using sync && echo 3 | sudo tee /proc/sys/vm/drop_caches, but the problem persists. How did you do that @Eileen_Lin.
For me, adding --jobs=1 to the bazel command solved the problem
using -- local_ ram_ Resources = 40960 to limit the memory size to 40GB. Usually this is error raises when insufficient memory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.