diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2016-03-15 14:04:41 +0100 |
---|---|---|
committer | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2016-03-21 16:44:05 +0100 |
commit | 70d12b389773bfbe79c6d44ebb5ceca056565411 (patch) | |
tree | 713e99d0d30b687418071d323994c67c5abf09c1 /sonar-application | |
parent | 950454051f247863735b75d251bee8460c7e07be (diff) | |
download | sonarqube-70d12b389773bfbe79c6d44ebb5ceca056565411.tar.gz sonarqube-70d12b389773bfbe79c6d44ebb5ceca056565411.zip |
SONAR-7435 add sonar.ce.javaOpts and sonar.ce.javaAdditionalOpts
also enforce some JVM parameters
Diffstat (limited to 'sonar-application')
-rw-r--r-- | sonar-application/src/main/assembly/conf/sonar.properties | 12 | ||||
-rw-r--r-- | sonar-application/src/main/java/org/sonar/application/App.java | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/sonar-application/src/main/assembly/conf/sonar.properties b/sonar-application/src/main/assembly/conf/sonar.properties index 905c626599a..ae765e33d98 100644 --- a/sonar-application/src/main/assembly/conf/sonar.properties +++ b/sonar-application/src/main/assembly/conf/sonar.properties @@ -198,6 +198,18 @@ # COMPUTE ENGINE # The Compute Engine is responsible for processing background tasks. +# Compute Engine is executed in a dedicated Java process. By default heap size is 768Mb. +# Use the following property to customize JVM options. +# Recommendations: +# +# The HotSpot Server VM is recommended. The property -server should be added if server mode +# is not enabled by default on your environment: http://docs.oracle.com/javase/7/docs/technotes/guides/vm/server-class.html +# +#sonar.ce.javaOpts=-Xmx768m -Xms256m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true + +# Same as previous property, but allows to not repeat all other settings like -Xmx +#sonar.ce.javaAdditionalOpts= + # The number of workers in the Compute Engine. # Use the following property to configure 1 or more workers. Value must be >= 1. Default value is 1. # By default the Compute Engine uses a single worker and therefor processes tasks one at a time. 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 c66b5fade38..7067d122d11 100644 --- a/sonar-application/src/main/java/org/sonar/application/App.java +++ b/sonar-application/src/main/java/org/sonar/application/App.java @@ -107,6 +107,9 @@ public class App implements Stoppable { private static JavaCommand createCeServerCommand(Props props, File homeDir) { JavaCommand webServer = new JavaCommand("ce", CESERVER_PROCESS_INDEX) .setWorkDir(homeDir) + .addJavaOptions(ProcessProperties.CE_ENFORCED_JVM_ARGS) + .addJavaOptions(props.nonNullValue(ProcessProperties.CE_JAVA_OPTS)) + .addJavaOptions(props.nonNullValue(ProcessProperties.CE_JAVA_ADDITIONAL_OPTS)) .setClassName("org.sonar.ce.app.CeServer") .setArguments(props.rawProperties()) .addClasspath("./lib/common/*") |