OS: Linux
Distrib: Debian GNU/Linux 10 (buster)
bazel: v3.1.0
我尝试将 bazel 的内存限制设置为 4GB,但出现错误:
ERROR: Unrecognized option: --host_jvm_args=-Xmx4g
我使用的整个命令行:
bazel build --host_jvm_args=-Xmx4g --host_jvm_args=-Xms384m --local_ram_resources=4096 --disk_cache ./cache //tensorflow/tools/pip_package:build_pip_package
ERROR: Unrecognized option: --host_jvm_args=-Xmx4g
编辑1:
按照 @vertexwahn 的建议,使用这些--jvmopt="-Xmx:4G" --jvmopt="-Xms:512m"
选项成功:
bazel build --jvmopt="-Xmx:4G" --jvmopt="-Xms:512m" --disk_cache ./cache //tensorflow/tools/pip_package:build_pip_package
答案1
host_jvm_args
是一个选项 not for bazel build
but for bazel startup
,例如您可以将其放入.bazelrc