From 1a967d04eae33998087b7ee09068c9fb05a8696a Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 29 Jan 2015 10:08:24 +0100 Subject: [PATCH] SONAR-6115 SonarQube is slower whilst running with Java8 vs Java7 --- .../src/main/java/org/sonar/application/App.java | 2 +- .../src/main/java/org/sonar/application/DefaultSettings.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sonar-application/src/main/java/org/sonar/application/App.java b/sonar-application/src/main/java/org/sonar/application/App.java index b70b2666de1..5e40827c0a5 100644 --- a/sonar-application/src/main/java/org/sonar/application/App.java +++ b/sonar-application/src/main/java/org/sonar/application/App.java @@ -85,7 +85,7 @@ public class App implements Stoppable { if (StringUtils.isBlank(props.value(ProcessConstants.CLUSTER_MASTER_HOST))) { JavaCommand webServer = new JavaCommand("web") .setWorkDir(homeDir) - .addJavaOptions("-Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false") + .addJavaOptions(DefaultSettings.WEB_SERVER_FORCED_JVM_ARGS) .addJavaOptions(props.nonNullValue(ProcessConstants.WEB_JAVA_OPTS)) .addJavaOptions(props.nonNullValue(ProcessConstants.WEB_JAVA_ADDITIONAL_OPTS)) .setTempDir(tempDir.getAbsoluteFile()) diff --git a/sonar-application/src/main/java/org/sonar/application/DefaultSettings.java b/sonar-application/src/main/java/org/sonar/application/DefaultSettings.java index de9f68054fa..b301879e39b 100644 --- a/sonar-application/src/main/java/org/sonar/application/DefaultSettings.java +++ b/sonar-application/src/main/java/org/sonar/application/DefaultSettings.java @@ -28,6 +28,10 @@ import java.util.Map; class DefaultSettings { + public static final String WEB_SERVER_FORCED_JVM_ARGS = "-Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false " + + // jruby is slow with java 8: https://jira.codehaus.org/browse/SONAR-6115 + "-Djruby.compile.invokedynamic=false"; + private DefaultSettings() { // only static stuff } -- 2.39.5