diff --git a/src/main/cpp/blaze.cc b/src/main/cpp/blaze.cc index b1a350e99226a4..753689d015a962 100644 --- a/src/main/cpp/blaze.cc +++ b/src/main/cpp/blaze.cc @@ -432,6 +432,14 @@ static vector GetServerExeArgs(const blaze_util::Path &jvm_path, // https://github.com/openjdk/jdk/blob/2faf8b8d582183275b1fdc92313a1c63c1753e80/src/java.base/share/classes/sun/nio/fs/AbstractWatchKey.java#L40 result.push_back("-Djdk.nio.file.WatchService.maxEventsPerPoll=10000"); +#if defined(_WIN32) + // See and use more than 64 CPUs on Windows. + // https://bugs.openjdk.org/browse/JDK-6942632 + result.push_back("-XX:+IgnoreUnrecognizedVMOptions"); + result.push_back("-XX:+UseAllWindowsProcessorGroups"); + result.push_back("-XX:-IgnoreUnrecognizedVMOptions"); +#endif + if (startup_options.host_jvm_debug) { BAZEL_LOG(USER) << "Running host JVM under debugger (listening on TCP port 5005).";