can not build with server terminated message.
1 Answer
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.
4 Comments
Maf
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.Maf
I just cleaned my cache using s
ync && echo 3 | sudo tee /proc/sys/vm/drop_caches, but the problem persists. How did you do that @Eileen_Lin.mostafa.elhoushi
For me, adding
--jobs=1 to the bazel command solved the problemSG_Bazel
using -- local_ ram_ Resources = 40960 to limit the memory size to 40GB. Usually this is error raises when insufficient memory.
/home/elin/.cache/bazel/_bazel_elin/d60cb132a54ad1843b095cb9690d01e0/server/jvm.outfile from the error message? That should have more information.