diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-01-29 10:05:17 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-01-29 10:05:39 +0100 |
commit | 69a9025be5ef4e60d5514d0edcb009599164c41e (patch) | |
tree | 61d4dd7e6e6892bbdb343f86cf50ed4bf20ea08b /sonar-application/src/main | |
parent | 69991e63dbf10256359bf4f4427437ec1aafbb15 (diff) | |
download | sonarqube-69a9025be5ef4e60d5514d0edcb009599164c41e.tar.gz sonarqube-69a9025be5ef4e60d5514d0edcb009599164c41e.zip |
SONAR-6115 SonarQube is slower whilst running with Java8 vs Java7
Diffstat (limited to 'sonar-application/src/main')
-rw-r--r-- | sonar-application/src/main/java/org/sonar/application/App.java | 6 | ||||
-rw-r--r-- | sonar-application/src/main/java/org/sonar/application/DefaultSettings.java | 8 |
2 files changed, 9 insertions, 5 deletions
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..af325f1d370 100644 --- a/sonar-application/src/main/java/org/sonar/application/App.java +++ b/sonar-application/src/main/java/org/sonar/application/App.java @@ -65,7 +65,7 @@ public class App implements Stoppable { } List<JavaCommand> createCommands(Props props) { - List<JavaCommand> commands = new ArrayList<JavaCommand>(); + List<JavaCommand> commands = new ArrayList<>(); File homeDir = props.nonNullValueAsFile(ProcessConstants.PATH_HOME); File tempDir = props.nonNullValueAsFile(ProcessConstants.PATH_TEMP); JavaCommand elasticsearch = new JavaCommand("search"); @@ -85,11 +85,11 @@ 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()) - // required for logback tomcat valve + // required for logback tomcat valve .setEnvVariable(ProcessConstants.PATH_LOGS, props.nonNullValue(ProcessConstants.PATH_LOGS)) .setClassName("org.sonar.server.app.WebServer") .setArguments(props.rawProperties()) 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..f06d5fed675 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 } @@ -56,7 +60,7 @@ class DefaultSettings { } private static Map<String, String> defaults() { - Map<String, String> defaults = new HashMap<String, String>(); + Map<String, String> defaults = new HashMap<>(); defaults.put(ProcessConstants.CLUSTER_NAME, "sonarqube"); defaults.put(ProcessConstants.SEARCH_JAVA_OPTS, "-Xmx1G -Xms256m -Xss256k -Djava.net.preferIPv4Stack=true " + "-XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly " + @@ -78,7 +82,7 @@ class DefaultSettings { } private static Map<String, Integer> defaultPorts() { - Map<String, Integer> defaults = new HashMap<String, Integer>(); + Map<String, Integer> defaults = new HashMap<>(); defaults.put(ProcessConstants.SEARCH_PORT, 9001); return defaults; } |