aboutsummaryrefslogtreecommitdiffstats
path: root/java/config
diff options
context:
space:
mode:
authorSasha Smundak <asmundak@google.com>2019-06-11 13:30:13 -0700
committerSasha Smundak <asmundak@google.com>2019-06-11 13:30:13 -0700
commit26c6d9e9fbc5bfe5f103a3bada6a5816f1de8a41 (patch)
treed328429aa2e0a8d76c94d0dab9d87209881ec9a7 /java/config
parentd7607c1c99d445d3aae93c25f492ed7a6fc53c07 (diff)
downloadbuild_soong-26c6d9e9fbc5bfe5f103a3bada6a5816f1de8a41.tar.gz
build_soong-26c6d9e9fbc5bfe5f103a3bada6a5816f1de8a41.tar.bz2
build_soong-26c6d9e9fbc5bfe5f103a3bada6a5816f1de8a41.zip
Tune JVM, print full diagnostics on crash.
JVM occasionally (0.5% time) crashes on entering a method with SIGSEGV. It might be due to excessive load on the host machine. Reduce the number of the compiler threads to 6, and do not start all the GC threads immediately. If JVM crashes, copy full diagnostics to stderr. Bug: 132766811 Test: treehugger Change-Id: Ib7bfd568f6d32456bf623cbb615ffc990c326a34
Diffstat (limited to 'java/config')
-rw-r--r--java/config/config.go2
-rw-r--r--java/config/makevars.go8
2 files changed, 6 insertions, 4 deletions
diff --git a/java/config/config.go b/java/config/config.go
index f9552d5a..6ade6493 100644
--- a/java/config/config.go
+++ b/java/config/config.go
@@ -69,6 +69,8 @@ func init() {
// b/65004097: prevent using java.lang.invoke.StringConcatFactory when using -target 1.9
`-XDstringConcat=inline`,
}, " "))
+ pctx.StaticVariable("JavaVmFlags", "-XX:OnError=\"cat hs_err_pid%p.log\" -XX:CICompilerCount=6 -XX:+UseDynamicNumberOfGCThreads")
+ pctx.StaticVariable("JavacVmFlags", "-J-XX:OnError=\"cat hs_err_pid%p.log\" -J-XX:CICompilerCount=6 -J-XX:+UseDynamicNumberOfGCThreads")
pctx.VariableConfigMethod("hostPrebuiltTag", android.Config.PrebuiltOS)
diff --git a/java/config/makevars.go b/java/config/makevars.go
index 9c785117..ead298ac 100644
--- a/java/config/makevars.go
+++ b/java/config/makevars.go
@@ -39,8 +39,8 @@ func makeVarsProvider(ctx android.MakeVarsContext) {
ctx.Strict("ANDROID_JAVA8_HOME", "prebuilts/jdk/jdk8/${hostPrebuiltTag}")
ctx.Strict("ANDROID_JAVA9_HOME", "prebuilts/jdk/jdk9/${hostPrebuiltTag}")
ctx.Strict("ANDROID_JAVA_TOOLCHAIN", "${JavaToolchain}")
- ctx.Strict("JAVA", "${JavaCmd}")
- ctx.Strict("JAVAC", "${JavacCmd}")
+ ctx.Strict("JAVA", "${JavaCmd} ${JavaVmFlags}")
+ ctx.Strict("JAVAC", "${JavacCmd} ${JavacVmFlags}")
ctx.Strict("JAR", "${JarCmd}")
ctx.Strict("JAR_ARGS", "${JarArgsCmd}")
ctx.Strict("JAVADOC", "${JavadocCmd}")
@@ -58,8 +58,8 @@ func makeVarsProvider(ctx android.MakeVarsContext) {
ctx.Strict("ERROR_PRONE_CHECKS", "${ErrorProneChecks}")
}
- ctx.Strict("TARGET_JAVAC", "${JavacCmd} ${CommonJdkFlags}")
- ctx.Strict("HOST_JAVAC", "${JavacCmd} ${CommonJdkFlags}")
+ ctx.Strict("TARGET_JAVAC", "${JavacCmd} ${JavacVmFlags} ${CommonJdkFlags}")
+ ctx.Strict("HOST_JAVAC", "${JavacCmd} ${JavacVmFlags} ${CommonJdkFlags}")
ctx.Strict("JLINK", "${JlinkCmd}")
ctx.Strict("JMOD", "${JmodCmd}")