From 9ad75916d9932a694fe0b18a039e1ef46bdd815d Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 26 May 2016 15:33:54 +0200 Subject: [PATCH] SONAR-7653 remove Java option XX:MaxPermSize this option is dropped from java 8 --- it/it-tests/src/test/java/it/plugins/PluginsTest.java | 1 - pom.xml | 2 +- .../src/main/java/org/sonar/process/ProcessProperties.java | 4 ++-- sonar-application/src/main/assembly/conf/sonar.properties | 4 ++-- .../sonarqube/perf/computation/ComputationTest.java | 2 +- .../sonarqube/perf/scanner/suite/BootstrappingTest.java | 4 ++-- .../sonarqube/perf/scanner/suite/FileSystemTest.java | 2 +- .../sonarqube/perf/scanner/suite/HighlightingTest.java | 2 +- .../sonarqube/perf/scanner/suite/IssuesModeTest.java | 2 +- .../sonarsource/sonarqube/perf/scanner/suite/MemoryTest.java | 2 +- .../sonarqube/perf/scanner/suite/ScannerPerfTestSuite.java | 2 +- .../org/sonarsource/sonarqube/perf/server/ServerTest.java | 2 +- 12 files changed, 14 insertions(+), 15 deletions(-) diff --git a/it/it-tests/src/test/java/it/plugins/PluginsTest.java b/it/it-tests/src/test/java/it/plugins/PluginsTest.java index ec97a4a1b45..f0b6059323c 100644 --- a/it/it-tests/src/test/java/it/plugins/PluginsTest.java +++ b/it/it-tests/src/test/java/it/plugins/PluginsTest.java @@ -141,7 +141,6 @@ public class PluginsTest { private static SonarScanner newAnalysis() { SonarScanner analysis = SonarScanner.create(Project.basedir()); - analysis.setEnvironmentVariable("SONAR_RUNNER_OPTS", "-XX:MaxPermSize=128m"); // required to bypass usage of build-wrapper analysis.setProperties("sonar.cfamily.build-wrapper-output.bypass", "true"); diff --git a/pom.xml b/pom.xml index 2896622c35c..d248f5c9442 100644 --- a/pom.xml +++ b/pom.xml @@ -82,7 +82,7 @@ false false - -Xmx512m -Djava.awt.headless=true -XX:MaxPermSize=160m + -Xmx512m -Djava.awt.headless=true true diff --git a/server/sonar-process/src/main/java/org/sonar/process/ProcessProperties.java b/server/sonar-process/src/main/java/org/sonar/process/ProcessProperties.java index 550a7014f0d..57e5c7eb450 100644 --- a/server/sonar-process/src/main/java/org/sonar/process/ProcessProperties.java +++ b/server/sonar-process/src/main/java/org/sonar/process/ProcessProperties.java @@ -115,9 +115,9 @@ public class ProcessProperties { "-XX:+HeapDumpOnOutOfMemoryError"); defaults.put(ProcessProperties.SEARCH_JAVA_ADDITIONAL_OPTS, ""); - defaults.put(ProcessProperties.WEB_JAVA_OPTS, "-Xmx512m -Xms128m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true"); + defaults.put(ProcessProperties.WEB_JAVA_OPTS, "-Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true"); defaults.put(ProcessProperties.WEB_JAVA_ADDITIONAL_OPTS, ""); - defaults.put(ProcessProperties.CE_JAVA_OPTS, "-Xmx512m -Xms128m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true"); + defaults.put(ProcessProperties.CE_JAVA_OPTS, "-Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true"); defaults.put(ProcessProperties.CE_JAVA_ADDITIONAL_OPTS, ""); defaults.put(ProcessProperties.JDBC_MAX_ACTIVE, "60"); defaults.put(ProcessProperties.JDBC_MAX_IDLE, "5"); diff --git a/sonar-application/src/main/assembly/conf/sonar.properties b/sonar-application/src/main/assembly/conf/sonar.properties index e816df50295..fc40e150757 100644 --- a/sonar-application/src/main/assembly/conf/sonar.properties +++ b/sonar-application/src/main/assembly/conf/sonar.properties @@ -88,7 +88,7 @@ # 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.web.javaOpts=-Xmx512m -Xms128m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true +#sonar.web.javaOpts=-Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true # Same as previous property, but allows to not repeat all other settings like -Xmx #sonar.web.javaAdditionalOpts= @@ -134,7 +134,7 @@ # 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=-Xmx512m -Xms128m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true +#sonar.ce.javaOpts=-Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true # Same as previous property, but allows to not repeat all other settings like -Xmx #sonar.ce.javaAdditionalOpts= diff --git a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/computation/ComputationTest.java b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/computation/ComputationTest.java index 86d305c6ab5..b720db5564c 100644 --- a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/computation/ComputationTest.java +++ b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/computation/ComputationTest.java @@ -48,7 +48,7 @@ public class ComputationTest extends PerfTestCase { .addPlugin(FileLocation.byWildcardMavenFilename(new File("../../plugins/sonar-xoo-plugin/target"), "sonar-xoo-plugin-*.jar")) .setServerProperty( "sonar.web.javaOpts", - String.format("-Xms%dm -Xmx%dm -XX:+HeapDumpOnOutOfMemoryError -XX:MaxPermSize=160m -Djava.awt.headless=true", MAX_HEAP_SIZE_IN_MEGA, MAX_HEAP_SIZE_IN_MEGA)) + String.format("-Xms%dm -Xmx%dm -XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true", MAX_HEAP_SIZE_IN_MEGA, MAX_HEAP_SIZE_IN_MEGA)) .setServerProperty("sonar.log.level", "DEBUG") .restoreProfileAtStartup(FileLocation.ofClasspath("/one-xoo-issue-per-line.xml")) .build(); diff --git a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/BootstrappingTest.java b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/BootstrappingTest.java index c14bf582c33..14d260f1639 100644 --- a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/BootstrappingTest.java +++ b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/BootstrappingTest.java @@ -75,7 +75,7 @@ public class BootstrappingTest extends PerfTestCase { "sonar.sources", "", "sonar.showProfiling", "true"); scanner - .setEnvironmentVariable("SONAR_RUNNER_OPTS", "-Xmx512m -server -XX:MaxPermSize=64m") + .setEnvironmentVariable("SONAR_RUNNER_OPTS", "-Xmx512m -server") .setProjectDir(manyFlatModulesBaseDir); BuildResult result = orchestrator.executeBuild(scanner); @@ -117,7 +117,7 @@ public class BootstrappingTest extends PerfTestCase { "sonar.projectVersion", "1.0", "sonar.sources", "", "sonar.showProfiling", "true"); - scanner.setEnvironmentVariable("SONAR_RUNNER_OPTS", "-Xmx512m -server -XX:MaxPermSize=64m"); + scanner.setEnvironmentVariable("SONAR_RUNNER_OPTS", "-Xmx512m -server"); scanner.setProjectDir(manyNestedModulesBaseDir); BuildResult result = orchestrator.executeBuild(scanner); diff --git a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/FileSystemTest.java b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/FileSystemTest.java index e1ba5264111..d9987051f3d 100644 --- a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/FileSystemTest.java +++ b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/FileSystemTest.java @@ -79,7 +79,7 @@ public class FileSystemTest extends PerfTestCase { "sonar.sources", "src", "sonar.analysis.mode", "issues", "sonar.showProfiling", "true") - .setEnvironmentVariable("SONAR_RUNNER_OPTS", "-Xmx" + xmx + "m -server -XX:MaxPermSize=64m") + .setEnvironmentVariable("SONAR_RUNNER_OPTS", "-Xmx" + xmx + "m -server") .setProjectDir(baseDir); orchestrator.executeBuild(runner); diff --git a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/HighlightingTest.java b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/HighlightingTest.java index 615cf6a976f..4cac738fdfe 100644 --- a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/HighlightingTest.java +++ b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/HighlightingTest.java @@ -92,7 +92,7 @@ public class HighlightingTest extends PerfTestCase { "sonar.projectVersion", "1.0", "sonar.sources", "src", "sonar.showProfiling", "true"); - scanner.setEnvironmentVariable("SONAR_RUNNER_OPTS", "-Xmx512m -server -XX:MaxPermSize=64m") + scanner.setEnvironmentVariable("SONAR_RUNNER_OPTS", "-Xmx512m -server") .setProjectDir(baseDir); BuildResult result = orchestrator.executeBuild(scanner); diff --git a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/IssuesModeTest.java b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/IssuesModeTest.java index fd930cd5ee2..046e1309f51 100644 --- a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/IssuesModeTest.java +++ b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/IssuesModeTest.java @@ -59,7 +59,7 @@ public class IssuesModeTest extends PerfTestCase { orchestrator.getServer().provisionProject("sample", "xoo-sample"); orchestrator.getServer().associateProjectToQualityProfile("sample", "xoo", "one-xoo-issue-per-line"); SonarScanner runner = newScanner( - "-Xmx512m -server -XX:MaxPermSize=64m", + "-Xmx512m -server", "sonar.analysis.mode", "issues", "sonar.userHome", userHome.getAbsolutePath(), "sonar.showProfiling", "true"); diff --git a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/MemoryTest.java b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/MemoryTest.java index ce903b56590..c6d6412e18d 100644 --- a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/MemoryTest.java +++ b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/MemoryTest.java @@ -85,7 +85,7 @@ public class MemoryTest extends PerfTestCase { "sonar.projectVersion", "1.0", "sonar.sources", "", "sonar.showProfiling", "true"); - scanner.setEnvironmentVariable("SONAR_RUNNER_OPTS", "-Xmx512m -server -XX:MaxPermSize=64m") + scanner.setEnvironmentVariable("SONAR_RUNNER_OPTS", "-Xmx512m -server") .setProjectDir(baseDir); BuildResult result = orchestrator.executeBuild(scanner); diff --git a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/ScannerPerfTestSuite.java b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/ScannerPerfTestSuite.java index 7365b8f5da9..cc3c6793077 100644 --- a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/ScannerPerfTestSuite.java +++ b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/ScannerPerfTestSuite.java @@ -45,7 +45,7 @@ public class ScannerPerfTestSuite { .builderEnv() .addPlugin(FileLocation.byWildcardMavenFilename(new File("../../plugins/sonar-xoo-plugin/target"), "sonar-xoo-plugin-*.jar")) // should not be so high, but required as long embedded h2 is used -> requires more memory on server - .setServerProperty("sonar.web.javaOpts", "-Xmx1G -XX:MaxPermSize=100m -XX:+HeapDumpOnOutOfMemoryError") + .setServerProperty("sonar.web.javaOpts", "-Xmx1G -XX:+HeapDumpOnOutOfMemoryError") // Needed by DuplicationTest::hugeJavaFile .setOrchestratorProperty("javaVersion", "LATEST_RELEASE").addPlugin("java") .restoreProfileAtStartup(FileLocation.ofClasspath("/one-xoo-issue-per-line.xml")) diff --git a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/server/ServerTest.java b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/server/ServerTest.java index ca2520b0247..d0c17e807ff 100644 --- a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/server/ServerTest.java +++ b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/server/ServerTest.java @@ -40,7 +40,7 @@ public class ServerTest extends PerfTestCase { // ES + TOMCAT @Test public void server_startup_and_shutdown() throws Exception { - String defaultWebJavaOptions = "-Xmx768m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false"; + String defaultWebJavaOptions = "-Xmx768m -XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false"; Orchestrator orchestrator = Orchestrator.builderEnv() .setOrchestratorProperty("javaVersion", "LATEST_RELEASE") .addPlugin("java") -- 2.39.5