Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8180488

Memory consumption using "kill switch"

XMLWordPrintable

    • x86_64
    • linux

      FULL PRODUCT VERSION :
      jdk-9-ea+168_linux-x64

      ADDITIONAL OS VERSION INFORMATION :
      Distributor ID: Ubuntu
      Description: Ubuntu 14.04.5 LTS
      Release: 14.04
      Codename: trusty (Linux 4.4.0-45-generic)

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Travis configuration copied from https://travis-ci.org/junit-team/junit5/jobs/232398716/config

      {
        "language": "java",
        "sudo": false,
        "dist": "trusty",
        "install": [
          "cd ..",
          "wget http://download.java.net/java/jdk9/archive/168/binaries/jdk-9-ea+168_linux-x64_bin.tar.gz",
          "tar -xzf jdk-9-ea+168_linux-x64_bin.tar.gz",
          "export JAVA_HOME=$PWD/jdk-9",
          "PATH=$JAVA_HOME/bin:$PATH",
          "cd -"
        ],
        "script": [
          "./gradlew check --scan"
        ],
        "group": "stable",
        "env": "JDK_JAVA_OPTIONS='--permit-illegal-access'",
        "jdk": "oraclejdk9",
        "os": "linux"
      }

      A DESCRIPTION OF THE PROBLEM :
      While building JUnit 5 on Travis CI using jdk-9-b168 on branch [1] I used the "kill switch" to allow Gradle/Groovy perform their work with illegal accesses allowed. The build failed due to an OutOfMemoryException. See [2] for the logs.

      When I replace the "kill switch" with "--add-opens" options, the build runs. See [3] for details.


      [1] https://github.com/junit-team/junit5/pull/842/commits
      [2] https://travis-ci.org/junit-team/junit5/jobs/232398716#L947
      [3] https://travis-ci.org/junit-team/junit5/jobs/232406998

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Clone master branch https://github.com/junit-team/junit5 and replace all "--add-opens" options with the single "--permit-illegal-access". Commit, push and wait for Travis to pick up the cloned branch.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The build should run and terminate without an error.
      ACTUAL -
      The build crashes with error:
        "Process 'Gradle Test Executor 2' finished with non-zero exit value 137"

      http://stackoverflow.com/questions/38967991/why-are-my-gradle-builds-dying-with-exit-code-137

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      https://travis-ci.org/junit-team/junit5/jobs/232398716#L947

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      .travis.yml from

      language: java
      sudo: false
      dist: trusty

      matrix:
        include:
          - jdk: oraclejdk8
            addons: {apt: {packages: [oracle-java8-installer]}}
          - jdk: oraclejdk9
            install:
              - cd ..
              - wget http://download.java.net/java/jdk9/archive/168/binaries/jdk-9-ea+168_linux-x64_bin.tar.gz
              - tar -xzf jdk-9-ea+168_linux-x64_bin.tar.gz
              - export JAVA_HOME=$PWD/jdk-9
              - PATH=$JAVA_HOME/bin:$PATH
              - cd -
              - ./gradlew -version
            env: JDK_JAVA_OPTIONS='--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED'
                 #JDK_JAVA_OPTIONS='--permit-illegal-access' # PRODUCES EXIT VALUE 137 !!!

      # Display Gradle version instead of letting Travis execute './gradlew assemble' by default
      install:
        - ./gradlew -version

      script:
        - ./gradlew check --scan
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Use:

        JDK_JAVA_OPTIONS='--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED'

      instead of:

        JDK_JAVA_OPTIONS='--permit-illegal-access'

            alanb Alan Bateman
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: