Bigtop
  1. Bigtop
  2. BIGTOP-472

make deb fails when building Whirr - OutOfMemoryError: PermGen space

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.3.0
    • Fix Version/s: 0.4.0
    • Component/s: debian
    • Labels:
    • Environment:

      Ubuntu 10.04 LTS (Lucid). Sun JDK 1.6.0_26-b03

      Description

      During 'make deb' Whirr fails to build because the Sun JVM (running Maven) is out of Permanent Generation space (this is not heap space).
      By setting the env variable MAVEN_OPTS=-XX:MaxPermSize=128m this parameter will be used when Maven evokes the JVM and 128m seems to be sufficient PermGen space to complete the make deb (I have tested this).

      HOWEVER, setting this env variable is not enough. There needs to be a change to package.mk so debuild will 'perserve' this env variable and pass it to the (presumably) forked process where maven runs. See the debuild man pages ENVIRONMENT VARIABLES section for documentation on this.

      So, without the MAVEN_OPTS env var 'preserved' by debuild in package.mk, setting MAVEN_OPTS alone will have no affect on make deb.

      Attached is a suggested change to package.mk (just adding --preserve-envvar MAVEN_OPTS ) - not sure if this is the best way to handle this, but this is what I did locally to complete make deb on 0.3.0

      Here is the make deb output of the error:
      [INFO]
      [INFO] Apache Whirr Build Tools .......................... SUCCESS [5.186s]
      [INFO] Whirr ............................................. SUCCESS [47.677s]
      [INFO] Apache Whirr Core ................................. SUCCESS [44.167s]
      [INFO] Apache Whirr Cassandra ............................ SUCCESS [18.302s]
      [INFO] Apache Whirr Hadoop ............................... SUCCESS [14.291s]
      [INFO] Apache Whirr ZooKeeper ............................ SUCCESS [11.758s]
      [INFO] Apache Whirr HBase ................................ SUCCESS [14.493s]
      [INFO] Apache Whirr CDH .................................. SUCCESS [6.571s]
      [INFO] Apache Whirr Ganglia .............................. SUCCESS [10.758s]
      [INFO] Apache Whirr Mahout ............................... SUCCESS [11.585s]
      [INFO] Apache Whirr ElasticSearch ........................ FAILURE [6.547s]
      [INFO] Apache Whirr Hama ................................. SKIPPED
      [INFO] Apache Whirr Puppet ............................... SKIPPED
      [INFO] Apache Whirr Chef ................................. SKIPPED
      [INFO] Apache Whirr CLI .................................. SKIPPED
      [INFO] Apache Whirr Examples ............................. SKIPPED
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 3:14.536s
      [INFO] Finished at: Tue Mar 20 00:24:00 UTC 2012
      [INFO] Final Memory: 50M/325M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project whirr-elasticsearch: Compilation failure
      [ERROR] Failure executing javac, but could not parse the error:
      [ERROR]
      [ERROR]
      [ERROR] The system is out of resources.
      [ERROR] Consult the following stack trace for details.
      [ERROR] java.lang.OutOfMemoryError: PermGen space
      [ERROR] at java.lang.ClassLoader.defineClass1(Native Method)
      [ERROR] at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
      [ERROR] at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
      [ERROR] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
      [ERROR] at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
      [ERROR] at java.net.URLClassLoader.access$000(URLClassLoader.java:58)

      1. BIGTOP-472-diff.txt
        0.5 kB
        Ron Bogdanoff
      2. package.mk.diff
        0.7 kB
        Ron Bogdanoff

        Issue Links

          Activity

          Hide
          Ron Bogdanoff added a comment -

          suggested patch

          Show
          Ron Bogdanoff added a comment - suggested patch
          Hide
          Bruno Mahé added a comment -

          Thanks a lot Ron!
          Out of curiosity, which version of Apache Maven are you using?

          Show
          Bruno Mahé added a comment - Thanks a lot Ron! Out of curiosity, which version of Apache Maven are you using?
          Hide
          David Liu added a comment -

          Another data point:

          When I used maven 3.0.4, I also met with the same PermGen error. Setting the property MAVEN_OPTS in .bashrc or /etc/environment has no effect. But after putting it in .mavenrc, it worked.

          Show
          David Liu added a comment - Another data point: When I used maven 3.0.4, I also met with the same PermGen error. Setting the property MAVEN_OPTS in .bashrc or /etc/environment has no effect. But after putting it in .mavenrc, it worked.
          Hide
          Ron Bogdanoff added a comment -

          Hi Bruno,
          I am using mvn 3.0.3

          Show
          Ron Bogdanoff added a comment - Hi Bruno, I am using mvn 3.0.3
          Hide
          Roman Shaposhnik added a comment -

          My suggestion would be to make this part of the do-component-build. It seems like we have a few components with unusual memory requirements and the rest of them shouldn't suffer.

          Show
          Roman Shaposhnik added a comment - My suggestion would be to make this part of the do-component-build. It seems like we have a few components with unusual memory requirements and the rest of them shouldn't suffer.
          Hide
          Ron Bogdanoff added a comment -

          As per Roman's suggestion, set MAVEN_OPTS in whirr do-component-build. Note: this patch will work for Sun/Oracle JVM and OpenJDK. Other JVMs (e.g. JRocket) will fail as 'permanent generation space' is specific to Sun JVM architecture. Patch file BIGTOP-472-diff.txt is attached

          Show
          Ron Bogdanoff added a comment - As per Roman's suggestion, set MAVEN_OPTS in whirr do-component-build. Note: this patch will work for Sun/Oracle JVM and OpenJDK. Other JVMs (e.g. JRocket) will fail as 'permanent generation space' is specific to Sun JVM architecture. Patch file BIGTOP-472 -diff.txt is attached
          Hide
          Ron Bogdanoff added a comment -

          patch for BIGTOP-472

          Show
          Ron Bogdanoff added a comment - patch for BIGTOP-472
          Hide
          Roman Shaposhnik added a comment -

          Ron, thanks a million for the patch! Looks good.

          +1

          Show
          Roman Shaposhnik added a comment - Ron, thanks a million for the patch! Looks good. +1

            People

            • Assignee:
              Roman Shaposhnik
              Reporter:
              Ron Bogdanoff
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development