aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google
diff options
context:
space:
mode:
authorGravatar Janak Ramakrishnan <janakr@google.com>2015-07-29 21:13:23 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2015-07-30 11:32:42 +0000
commit3746af617bd36ae05a34ee2b4d2195678bcca9db (patch)
treee076622b6d40f9ea00fdff7b6ae876a1b43a1dd3 /src/main/java/com/google
parent3eb686636b1a150ae18e97b586036f2e0709291f (diff)
Remove vestigial references to 32-bit/64-bit binaries.
-- MOS_MIGRATED_REVID=99411524
Diffstat (limited to 'src/main/java/com/google')
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java59
1 files changed, 0 insertions, 59 deletions
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 d1793cfe2c..8afb03a17c 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
@@ -125,8 +125,6 @@ import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
-import java.lang.management.ManagementFactory;
-import java.lang.management.MemoryMXBean;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
@@ -155,22 +153,6 @@ import javax.annotation.Nullable;
* and will be passed around as needed.
*/
public final class BlazeRuntime {
- /**
- * The threshold for memory reserved by a 32-bit JVM before trouble may be expected.
- *
- * <p>After the JVM starts, it reserves memory for heap (controlled by -Xmx) and non-heap
- * (code, PermGen, etc.). Furthermore, as Blaze spawns threads, each thread reserves memory
- * for the stack (controlled by -Xss). Thus even if Blaze starts fine, with high memory settings
- * it will die from a stack allocation failure in the middle of a build. We prefer failing
- * upfront by setting a safe threshold.
- *
- * <p>This does not apply to 64-bit VMs.
- */
- private static final long MAX_BLAZE32_RESERVED_MEMORY = 3400 * 1048576L;
-
- // Less than this indicates tampering with -Xmx settings.
- private static final long MIN_BLAZE32_HEAP_SIZE = 3000 * 1000000L;
-
public static final String DO_NOT_BUILD_FILE_NAME = "DO_NOT_BUILD_HERE";
private static final Pattern suppressFromLog = Pattern.compile(".*(auth|pass|cookie).*",
@@ -1278,11 +1260,6 @@ public final class BlazeRuntime {
LOG.info("Running Blaze in batch mode with startup args "
+ commandLineOptions.getStartupArgs());
- String memoryWarning = validateJvmMemorySettings();
- if (memoryWarning != null) {
- OutErr.SYSTEM_OUT_ERR.printErrLn(memoryWarning);
- }
-
BlazeRuntime runtime;
try {
runtime = newRuntime(modules, parseOptions(modules, commandLineOptions.getStartupArgs()));
@@ -1345,7 +1322,6 @@ public final class BlazeRuntime {
final BlazeRuntime runtime = newRuntime(modules, options);
final BlazeCommandDispatcher dispatcher =
new BlazeCommandDispatcher(runtime, getBuiltinCommandList());
- final String memoryWarning = validateJvmMemorySettings();
final ServerCommand blazeCommand;
@@ -1356,9 +1332,6 @@ public final class BlazeRuntime {
@Override
public int exec(List<String> args, OutErr outErr, long firstContactTime) {
LOG.info(getRequestLogString(args));
- if (memoryWarning != null) {
- outErr.printErrLn(memoryWarning);
- }
try {
return dispatcher.exec(args, outErr, firstContactTime);
@@ -1526,38 +1499,6 @@ public final class BlazeRuntime {
}
/**
- * Returns null if JVM memory settings are considered safe, and an error string otherwise.
- */
- private static String validateJvmMemorySettings() {
- boolean is64BitVM = "64".equals(System.getProperty("sun.arch.data.model"));
- if (is64BitVM) {
- return null;
- }
- MemoryMXBean mem = ManagementFactory.getMemoryMXBean();
- long heapSize = mem.getHeapMemoryUsage().getMax();
- long nonHeapSize = mem.getNonHeapMemoryUsage().getMax();
- if (heapSize == -1 || nonHeapSize == -1) {
- return null;
- }
-
- if (heapSize + nonHeapSize > MAX_BLAZE32_RESERVED_MEMORY) {
- return String.format(
- "WARNING: JVM reserved %d MB of virtual memory (above threshold of %d MB). "
- + "This may result in OOMs at runtime. Use lower values of MaxPermSize "
- + "or switch to blaze64.",
- (heapSize + nonHeapSize) >> 20, MAX_BLAZE32_RESERVED_MEMORY >> 20);
- } else if (heapSize < MIN_BLAZE32_HEAP_SIZE) {
- return String.format(
- "WARNING: JVM heap size is %d MB. You probably have a custom -Xmx setting in your "
- + "local Blaze configuration. This may result in OOMs. Removing overrides of -Xmx "
- + "settings is advised.",
- heapSize >> 20);
- } else {
- return null;
- }
- }
-
- /**
* Make sure async threads cannot be orphaned. This method makes sure bugs are reported to
* telemetry and the proper exit code is reported.
*/