From 7eb13c86cafb14b8d7afbb3737a27fb3c6fe9d51 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Wed, 8 Oct 2014 13:33:35 +0200 Subject: [PATCH] SONAR-5710 Some JVM options should not be configurable --- .../src/main/assembly/conf/sonar.properties | 12 ++++++------ .../src/main/java/org/sonar/application/App.java | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/sonar-application/src/main/assembly/conf/sonar.properties b/sonar-application/src/main/assembly/conf/sonar.properties index ff26347346f..e3477959f1b 100644 --- a/sonar-application/src/main/assembly/conf/sonar.properties +++ b/sonar-application/src/main/assembly/conf/sonar.properties @@ -66,10 +66,10 @@ sonar.jdbc.timeBetweenEvictionRunsMillis=30000 # Use the following property to customize JVM options. Enabling the HotSpot Server VM # mode (-server) is recommended. # Note that the option -Dfile.encoding=UTF-8 is mandatory. -#sonar.web.javaOpts=-Xmx768m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError \ -# -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false +#sonar.web.javaOpts=-Xmx768m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError -# Same as previous property, but allows to not repeat all settings like -Djava.awt.headless=true +# Same as previous property, but allows to not repeat all other settings +# like -Djava.awt.headless=true #sonar.web.javaAdditionalOpts= # Binding IP address. For servers with more than one IP address, this property specifies which @@ -173,10 +173,10 @@ sonar.jdbc.timeBetweenEvictionRunsMillis=30000 # JVM options. Note that enabling the HotSpot Server VM mode (-server) is recommended. #sonar.search.javaOpts=-Xmx256m -Xms256m -Xss256k -Djava.net.preferIPv4Stack=true \ # -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 \ -# -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError \ -# -Djava.awt.headless=true +# -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -# Same as previous property, but allows to not repeat all settings like -Djava.awt.headless=true +# Same as previous property, but allows to not repeat all other settings +# like -Djava.awt.headless=true #sonar.search.javaAdditionalOpts= # Elasticsearch port. Default is 9001. Use 0 to get a free port. 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 ff8016fabc8..9c027abebdf 100644 --- a/sonar-application/src/main/java/org/sonar/application/App.java +++ b/sonar-application/src/main/java/org/sonar/application/App.java @@ -70,6 +70,7 @@ public class App implements Stoppable { JavaCommand elasticsearch = new JavaCommand("search"); elasticsearch .setWorkDir(homeDir) + .addJavaOptions("-Djava.awt.headless=true") .addJavaOptions(props.nonNullValue(DefaultSettings.SEARCH_JAVA_OPTS)) .addJavaOptions(props.nonNullValue(DefaultSettings.SEARCH_JAVA_ADDITIONAL_OPTS)) .setTempDir(tempDir.getAbsoluteFile()) @@ -83,6 +84,7 @@ public class App implements Stoppable { if (StringUtils.isEmpty(props.value(DefaultSettings.CLUSTER_MASTER))) { JavaCommand webServer = new JavaCommand("web") .setWorkDir(homeDir) + .addJavaOptions("-Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false") .addJavaOptions(props.nonNullValue(DefaultSettings.WEB_JAVA_OPTS)) .addJavaOptions(props.nonNullValue(DefaultSettings.WEB_JAVA_ADDITIONAL_OPTS)) .setTempDir(tempDir.getAbsoluteFile()) -- 2.39.5