Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-10689

JDKInstaller fails with OutOfMemory exception

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Component/s: core, ssh-slaves-plugin
    • Labels:
      None
    • Environment:
      Redhat Linux

      Description

      ssh-slaves fails to launch because JDKInstaller. See below the output.

      [08/12/11 14:01:32] [SSH] Checking java version of /usr/bin/java
      Couldn't figure out the Java version of /usr/bin/java
      bash: /usr/bin/java: No such file or directory

      [08/12/11 14:01:32] [SSH] Checking java version of /usr/java/default/bin/java
      Couldn't figure out the Java version of /usr/java/default/bin/java
      bash: /usr/java/default/bin/java: No such file or directory

      [08/12/11 14:01:32] [SSH] Checking java version of /usr/java/latest/bin/java
      Couldn't figure out the Java version of /usr/java/latest/bin/java
      bash: /usr/java/latest/bin/java: No such file or directory

      [08/12/11 14:01:32] [SSH] Checking java version of /usr/local/bin/java
      Couldn't figure out the Java version of /usr/local/bin/java
      bash: /usr/local/bin/java: No such file or directory

      [08/12/11 14:01:32] [SSH] Checking java version of /usr/local/java/bin/java
      Couldn't figure out the Java version of /usr/local/java/bin/java
      bash: /usr/local/java/bin/java: No such file or directory

      [08/12/11 14:01:32] [SSH] Checking java version of /hudson/jdk/bin/java
      Couldn't figure out the Java version of /hudson/jdk/bin/java
      bash: /hudson/jdk/bin/java: No such file or directory

      Linux cu003.h.sp.collab.net 2.6.18-194.el5PAE #1 SMP Fri Apr 2 15:37:44 EDT 2010 i686 i686 i386 GNU/Linux
      Installing JDK jdk-6u16-oth-JPR@CDS-CDS_Developer
      Downloading JDK from http://download.oracle.com/otn/java/jdk/6u16-b01//jdk-6u16-linux-i586.bin
      ERROR: Unexpected error in launching a slave. This is probably a bug in Hudson.
      java.lang.OutOfMemoryError: Java heap space
      at org.apache.commons.io.output.ByteArrayOutputStream.toByteArray(ByteArrayOutputStream.java:271)
      at org.apache.commons.io.IOUtils.toByteArray(IOUtils.java:219)
      at com.gargoylesoftware.htmlunit.WebResponseData.getBody(WebResponseData.java:133)
      at com.gargoylesoftware.htmlunit.WebResponseData.<init>(WebResponseData.java:86)
      at com.gargoylesoftware.htmlunit.HttpWebConnection.newWebResponseDataInstance(HttpWebConnection.java:443)
      at com.gargoylesoftware.htmlunit.HttpWebConnection.makeWebResponse(HttpWebConnection.java:423)
      at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:100)
      at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1456)
      at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1387)
      at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1513)
      at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1387)
      at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1513)
      at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1387)
      at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1513)
      at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1387)
      at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1513)
      at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1387)
      at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:328)
      at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:357)
      at com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:196)
      at hudson.tools.JDKInstaller.locate(JDKInstaller.java:388)
      at hudson.plugins.sshslaves.SSHLauncher.attemptToInstallJDK(SSHLauncher.java:292)
      at hudson.plugins.sshslaves.SSHLauncher.resolveJava(SSHLauncher.java:228)
      at hudson.plugins.sshslaves.SSHLauncher.launch(SSHLauncher.java:184)
      at com.collabnet.hudson.CubitLauncher.launch(CubitLauncher.java:70)
      at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:199)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:662)

        Issue Links

          Activity

          Hide
          drsgoodall drsgoodall added a comment -

          I'm having similar issues when a job attempts to download a JDK on my master node. This has only occurred for me in recent versions of Jenkins after the oracle login change. Looking at the JDKInstaller source I've noticed the following suspicious comment in the locate(...) method;

          // TODO: there's awful inefficiency in htmlunit where it loads the whole binary into one big byte array.
          // needs to modify it to use temporary file or something

          https://github.com/jenkinsci/jenkins/blob/6f335c3d7e30cc7b96b09c3be3b74c526b06cb05/core/src/main/java/hudson/tools/JDKInstaller.java

          So it seems like the entire JDK binary is loaded into a byte array before being saved to disk. This certainly seems likely to cause issues.

          Show
          drsgoodall drsgoodall added a comment - I'm having similar issues when a job attempts to download a JDK on my master node. This has only occurred for me in recent versions of Jenkins after the oracle login change. Looking at the JDKInstaller source I've noticed the following suspicious comment in the locate(...) method; // TODO: there's awful inefficiency in htmlunit where it loads the whole binary into one big byte array. // needs to modify it to use temporary file or something https://github.com/jenkinsci/jenkins/blob/6f335c3d7e30cc7b96b09c3be3b74c526b06cb05/core/src/main/java/hudson/tools/JDKInstaller.java So it seems like the entire JDK binary is loaded into a byte array before being saved to disk. This certainly seems likely to cause issues.
          Hide
          drsgoodall drsgoodall added a comment -

          It looks like htmlunit version 2.8 has support for large binary downloads. Jenkins appears to be using version 2.6.

          Show
          drsgoodall drsgoodall added a comment - It looks like htmlunit version 2.8 has support for large binary downloads. Jenkins appears to be using version 2.6.
          Hide
          kohsuke Kohsuke Kawaguchi added a comment -

          Thanks for the tip about 2.8. I'll look at that.

          Show
          kohsuke Kohsuke Kawaguchi added a comment - Thanks for the tip about 2.8. I'll look at that.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          core/pom.xml
          core/src/main/java/hudson/tools/JDKInstaller.java
          test/pom.xml
          http://jenkins-ci.org/commit/jenkins/83f204fd5933be1a990c2fe50a5f91ca77c75e87
          Log:
          [FIXED JENKINS-10689]

          integrating newer version of HtmlUnit to fix
          memory inefficiency problem.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html core/pom.xml core/src/main/java/hudson/tools/JDKInstaller.java test/pom.xml http://jenkins-ci.org/commit/jenkins/83f204fd5933be1a990c2fe50a5f91ca77c75e87 Log: [FIXED JENKINS-10689] integrating newer version of HtmlUnit to fix memory inefficiency problem.
          Hide
          dogfood dogfood added a comment -

          Integrated in jenkins_main_trunk #1131
          [FIXED JENKINS-10689]

          Kohsuke Kawaguchi : 83f204fd5933be1a990c2fe50a5f91ca77c75e87
          Files :

          • test/pom.xml
          • core/pom.xml
          • changelog.html
          • core/src/main/java/hudson/tools/JDKInstaller.java
          Show
          dogfood dogfood added a comment - Integrated in jenkins_main_trunk #1131 [FIXED JENKINS-10689] Kohsuke Kawaguchi : 83f204fd5933be1a990c2fe50a5f91ca77c75e87 Files : test/pom.xml core/pom.xml changelog.html core/src/main/java/hudson/tools/JDKInstaller.java
          Hide
          noorul Noorul Islam Kamal Malmiyoda added a comment -

          Is there any timeline to release jenkins with this fix?

          Show
          noorul Noorul Islam Kamal Malmiyoda added a comment - Is there any timeline to release jenkins with this fix?
          Hide
          orrc Christopher Orr added a comment -

          It will be in the 1.432 release at the start of next week.

          Show
          orrc Christopher Orr added a comment - It will be in the 1.432 release at the start of next week.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          core/pom.xml
          core/src/main/java/hudson/tools/JDKInstaller.java
          test/pom.xml
          http://jenkins-ci.org/commit/jenkins/83f204fd5933be1a990c2fe50a5f91ca77c75e87
          Log:
          [FIXED JENKINS-10689]

          integrating newer version of HtmlUnit to fix
          memory inefficiency problem.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html core/pom.xml core/src/main/java/hudson/tools/JDKInstaller.java test/pom.xml http://jenkins-ci.org/commit/jenkins/83f204fd5933be1a990c2fe50a5f91ca77c75e87 Log: [FIXED JENKINS-10689] integrating newer version of HtmlUnit to fix memory inefficiency problem.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          core/pom.xml
          core/src/main/java/hudson/tools/JDKInstaller.java
          test/pom.xml
          http://jenkins-ci.org/commit/jenkins/51ba1becc090586d6f84d881072f182b9e1aafb1
          Log:
          [FIXED JENKINS-10689]

          integrating newer version of HtmlUnit to fix
          memory inefficiency problem.
          (cherry picked from commit 83f204fd5933be1a990c2fe50a5f91ca77c75e87)

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html core/pom.xml core/src/main/java/hudson/tools/JDKInstaller.java test/pom.xml http://jenkins-ci.org/commit/jenkins/51ba1becc090586d6f84d881072f182b9e1aafb1 Log: [FIXED JENKINS-10689] integrating newer version of HtmlUnit to fix memory inefficiency problem. (cherry picked from commit 83f204fd5933be1a990c2fe50a5f91ca77c75e87)

            People

            • Assignee:
              Unassigned
              Reporter:
              noorul Noorul Islam Kamal Malmiyoda
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: