public static final String WEB_JAVA_OPTS = "sonar.web.javaOpts";
public static final String WEB_JAVA_ADDITIONAL_OPTS = "sonar.web.javaAdditionalOpts";
+ public static final String CE_JAVA_OPTS = "sonar.ce.javaOpts";
+ public static final String CE_JAVA_ADDITIONAL_OPTS = "sonar.ce.javaAdditionalOpts";
+
/**
* Used by Orchestrator to ask for shutdown of monitor process
*/
// jruby is slow with java 8: https://jira.sonarsource.com/browse/SONAR-6115
"-Djruby.compile.invokedynamic=false";
+ public static final String CE_ENFORCED_JVM_ARGS = "-Djava.awt.headless=true -Dfile.encoding=UTF-8";
+
private ProcessProperties() {
// only static stuff
}
defaults.put(ProcessProperties.WEB_JAVA_OPTS, "-Xmx768m -Xms256m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true");
defaults.put(ProcessProperties.WEB_JAVA_ADDITIONAL_OPTS, "");
+ defaults.put(ProcessProperties.CE_JAVA_OPTS, "-Xmx768m -Xms256m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true");
+ defaults.put(ProcessProperties.CE_JAVA_ADDITIONAL_OPTS, "");
defaults.put(ProcessProperties.JDBC_URL, "jdbc:h2:tcp://localhost:9092/sonar");
defaults.put(ProcessProperties.JDBC_MAX_ACTIVE, "60");
defaults.put(ProcessProperties.JDBC_MAX_IDLE, "5");
# 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.
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/*")