aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Janak Ramakrishnan <janakr@google.com>2016-05-23 21:20:16 +0000
committerGravatar Yue Gan <yueg@google.com>2016-05-24 11:58:05 +0000
commit19fde1fc26d261fa95e115c3a0bfb0bd92f1e13a (patch)
tree6daec251962eb8d867413ec31e4b97997c96daca /src
parenta3b8f3586f38ccb1dd2197390813514ffccec44a (diff)
Separate killing Bazel on OOM using -XX:OnOutOfMemoryError and pessimistically OOMing when GC thrashing. The first seems to make us hang on OOM, which is kind of the opposite of what we want.
These flags are now even more terribly named than they used to be, but a rename can wait until we actually know what we want. -- MOS_MIGRATED_REVID=123036704
Diffstat (limited to 'src')
-rw-r--r--src/main/cpp/blaze.cc4
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java6
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/BlazeServerStartupOptions.java2
3 files changed, 7 insertions, 5 deletions
diff --git a/src/main/cpp/blaze.cc b/src/main/cpp/blaze.cc
index 72771a6966..f5eaa74291 100644
--- a/src/main/cpp/blaze.cc
+++ b/src/main/cpp/blaze.cc
@@ -517,9 +517,9 @@ static vector<string> GetArgumentArray() {
}
if (globals->options.oom_more_eagerly) {
result.push_back("--experimental_oom_more_eagerly");
- result.push_back("--experimental_oom_more_eagerly_threshold=" +
- ToString(globals->options.oom_more_eagerly_threshold));
}
+ result.push_back("--experimental_oom_more_eagerly_threshold=" +
+ ToString(globals->options.oom_more_eagerly_threshold));
if (globals->options.watchfs) {
result.push_back("--watchfs");
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java b/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java
index 1b9d821301..e9a91dcee4 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java
@@ -985,10 +985,12 @@ public final class BlazeRuntime {
}
BlazeServerStartupOptions startupOptions = options.getOptions(BlazeServerStartupOptions.class);
- if (startupOptions.batch && startupOptions.oomMoreEagerly) {
- new OomSignalHandler();
+ if (startupOptions.oomMoreEagerlyThreshold != 100) {
new RetainedHeapLimiter(startupOptions.oomMoreEagerlyThreshold).install();
}
+ if (startupOptions.oomMoreEagerly) {
+ new OomSignalHandler();
+ }
PathFragment workspaceDirectory = startupOptions.workspaceDirectory;
PathFragment installBase = startupOptions.installBase;
PathFragment outputBase = startupOptions.outputBase;
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 41690a7dc5..6a21aea930 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
@@ -181,7 +181,7 @@ public class BlazeServerStartupOptions extends OptionsBase {
defaultValue = "100", // NOTE: purely decorative! See class docstring.
category = "server startup",
help =
- "If --experimental_oom_more_eagerly is set, Blaze will OOM if, after two full GC's, more "
+ "If this flag is set, Blaze will OOM if, after two full GC's, more "
+ "than this percentage of the (old gen) heap is still occupied."
)
public int oomMoreEagerlyThreshold;