From 7b787f24d374d0ab755fe8dcf8c23786c2a582b5 Mon Sep 17 00:00:00 2001 From: rnveach Date: Tue, 14 Nov 2017 21:49:18 -0500 Subject: [PATCH] minor: fix memory problem for regression --- .ci/travis/checkstyle_regression_no_exception.sh | 4 +++- .travis.yml | 4 ++-- .../checkstyle/regression/report/ReportGenerator.java | 7 ++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.ci/travis/checkstyle_regression_no_exception.sh b/.ci/travis/checkstyle_regression_no_exception.sh index fed3acb..15f4574 100755 --- a/.ci/travis/checkstyle_regression_no_exception.sh +++ b/.ci/travis/checkstyle_regression_no_exception.sh @@ -24,7 +24,9 @@ git checkout master git reset --hard "${MASTER_COMMIT}" cd .. mvn clean package -Passembly -java -jar target/regression-tool-1.0-SNAPSHOT-all.jar -r "$CHECKSTYLE_PATH" -p test-branch -t contribution/checkstyle-tester +export MAVEN_OPTS="-Xmx2000m" +export JAVA_OPTS="-Xmx2000m" +java -Xmx2048m -jar target/regression-tool-1.0-SNAPSHOT-all.jar -r "$CHECKSTYLE_PATH" -p test-branch -t contribution/checkstyle-tester RESULT="$?" cat config-test-branch-*.xml rm config-test-branch-*.xml diff --git a/.travis.yml b/.travis.yml index 8c48d22..312bf10 100644 --- a/.travis.yml +++ b/.travis.yml @@ -74,13 +74,13 @@ matrix: - jdk: oraclejdk8 env: - DESC="checkstyle regression no exception on latest commit" - - CMD="./.ci/travis/checkstyle_regression_no_exception.sh HEAD HEAD^" + - CMD="export MAVEN_OPTS='-Xmx2000m' && export JAVA_OPTS='-Xmx2000m' && ./.ci/travis/checkstyle_regression_no_exception.sh HEAD HEAD^" # checkstyle regression no exception, changes to check (oraclejdk8) - jdk: oraclejdk8 env: - DESC="checkstyle regression no exception, changes to check" - - CMD="./.ci/travis/checkstyle_regression_no_exception.sh f0ed29b d2e0c4c 8.5-SNAPSHOT" + - CMD="export MAVEN_OPTS='-Xmx2000m' && export JAVA_OPTS='-Xmx2000m' && ./.ci/travis/checkstyle_regression_no_exception.sh f0ed29b d2e0c4c 8.5-SNAPSHOT" script: eval $CMD diff --git a/src/main/java/com/github/checkstyle/regression/report/ReportGenerator.java b/src/main/java/com/github/checkstyle/regression/report/ReportGenerator.java index 13cfb6e..993dcff 100644 --- a/src/main/java/com/github/checkstyle/regression/report/ReportGenerator.java +++ b/src/main/java/com/github/checkstyle/regression/report/ReportGenerator.java @@ -44,7 +44,7 @@ private ReportGenerator() { public static File generate( String testerPath, String repoPath, String branch, File configFile) throws InterruptedException, IOException { - final Process process = new ProcessBuilder() + final ProcessBuilder processB = new ProcessBuilder() .directory(new File(testerPath)) .command( "groovy", "diff.groovy", @@ -54,8 +54,9 @@ public static File generate( "-c", configFile.getAbsolutePath(), "-l", "projects-to-test-on.properties" ) - .inheritIO() - .start(); + .inheritIO(); + processB.environment().put("MAVEN_OPTS", "-Xmx2048m"); + final Process process = processB.start(); final int code = process.waitFor(); if (code != 0) { throw new IllegalStateException("an error occurred when running diff.groovy");