diff options
-rw-r--r-- | src/main/cpp/blaze.cc | 3 | ||||
-rw-r--r-- | src/main/cpp/blaze_startup_options.cc | 1 | ||||
-rw-r--r-- | src/main/cpp/blaze_startup_options.h | 2 | ||||
-rw-r--r-- | src/main/cpp/blaze_startup_options_common.cc | 8 | ||||
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/runtime/BlazeServerStartupOptions.java | 11 |
5 files changed, 25 insertions, 0 deletions
diff --git a/src/main/cpp/blaze.cc b/src/main/cpp/blaze.cc index 336dbc2d8e..9591a3cd96 100644 --- a/src/main/cpp/blaze.cc +++ b/src/main/cpp/blaze.cc @@ -271,6 +271,9 @@ static vector<string> GetArgumentArray() { } else { result.push_back("--nodeep_execroot"); } + if (globals->options.oom_more_eagerly) { + result.push_back("--experimental_oom_more_eagerly"); + } if (globals->options.watchfs) { result.push_back("--watchfs"); } diff --git a/src/main/cpp/blaze_startup_options.cc b/src/main/cpp/blaze_startup_options.cc index acb3b466f6..7a27abe1ec 100644 --- a/src/main/cpp/blaze_startup_options.cc +++ b/src/main/cpp/blaze_startup_options.cc @@ -51,6 +51,7 @@ BlazeStartupOptions::BlazeStartupOptions(const BlazeStartupOptions &rhs) batch_cpu_scheduling(rhs.batch_cpu_scheduling), io_nice_level(rhs.io_nice_level), max_idle_secs(rhs.max_idle_secs), + oom_more_eagerly(rhs.oom_more_eagerly), watchfs(rhs.watchfs), allow_configurable_attributes(rhs.allow_configurable_attributes), option_sources(rhs.option_sources), diff --git a/src/main/cpp/blaze_startup_options.h b/src/main/cpp/blaze_startup_options.h index 59b893ecf2..d82bfad00c 100644 --- a/src/main/cpp/blaze_startup_options.h +++ b/src/main/cpp/blaze_startup_options.h @@ -146,6 +146,8 @@ class BlazeStartupOptions { int max_idle_secs; + bool oom_more_eagerly; + // If true, Blaze will listen to OS-level file change notifications. bool watchfs; diff --git a/src/main/cpp/blaze_startup_options_common.cc b/src/main/cpp/blaze_startup_options_common.cc index a6404182eb..4b0633593b 100644 --- a/src/main/cpp/blaze_startup_options_common.cc +++ b/src/main/cpp/blaze_startup_options_common.cc @@ -50,6 +50,7 @@ void BlazeStartupOptions::Init() { // 3 hours (but only 5 seconds if used within a test) max_idle_secs = testing ? 5 : (3 * 3600); webstatus_port = 0; + oom_more_eagerly = false; watchfs = false; invocation_policy = NULL; } @@ -80,6 +81,7 @@ void BlazeStartupOptions::Copy( lhs->io_nice_level = rhs.io_nice_level; lhs->max_idle_secs = rhs.max_idle_secs; lhs->webstatus_port = rhs.webstatus_port; + lhs->oom_more_eagerly = rhs.oom_more_eagerly; lhs->watchfs = rhs.watchfs; lhs->allow_configurable_attributes = rhs.allow_configurable_attributes; lhs->fatal_event_bus_exceptions = rhs.fatal_event_bus_exceptions; @@ -204,6 +206,12 @@ blaze_exit_code::ExitCode BlazeStartupOptions::ProcessArg( } else if (GetNullaryOption(arg, "-x")) { fprintf(stderr, "WARNING: The -x startup option is now ignored " "and will be removed in a future release\n"); + } else if (GetNullaryOption(arg, "--experimental_oom_more_eagerly")) { + oom_more_eagerly = true; + option_sources["experimental_oom_more_eagerly"] = rcfile; + } else if (GetNullaryOption(arg, "--noexperimental_oom_more_eagerly")) { + oom_more_eagerly = false; + option_sources["experimental_oom_more_eagerly"] = rcfile; } else if (GetNullaryOption(arg, "--watchfs")) { watchfs = true; option_sources["watchfs"] = rcfile; diff --git a/src/main/java/com/google/devtools/build/lib/runtime/BlazeServerStartupOptions.java b/src/main/java/com/google/devtools/build/lib/runtime/BlazeServerStartupOptions.java index 9f6ce88ed1..bd07e166e1 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/BlazeServerStartupOptions.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/BlazeServerStartupOptions.java @@ -166,6 +166,17 @@ public class BlazeServerStartupOptions extends OptionsBase { + "$OUTPUT_BASE") public boolean deepExecRoot; + @Option( + name = "experimental_oom_more_eagerly", + defaultValue = "false", // NOTE: purely decorative! See class docstring. + category = "server startup", + help = + "If set, attempt to detect Java heap OOM conditions and exit before thrashing. Only " + + "honored when --batch is also passed. In some cases, builds that previously succeeded" + + " may OOM if they were close to OOMing before." + ) + public boolean oomMoreEagerly; + @Option(name = "block_for_lock", defaultValue = "true", // NOTE: purely decorative! See class docstring. category = "server startup", |