java.lang.OutOfMemoryError: Java heap space

Jenkins JIRA | Noorul Islam Kamal Malmiyoda | 6 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    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)

    Jenkins JIRA | 6 years ago | Noorul Islam Kamal Malmiyoda
    java.lang.OutOfMemoryError: Java heap space
  2. 0

    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)

    Jenkins JIRA | 6 years ago | Noorul Islam Kamal Malmiyoda
    java.lang.OutOfMemoryError: Java heap space
  3. 0

    java.lang.OutOfMemoryError when processing large pgp file

    Stack Overflow | 3 years ago | David
    java.lang.OutOfMemoryError: Java heap space
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Is there any way to handle Java heap space exception

    Stack Overflow | 2 years ago
    java.lang.OutOfMemoryError: Java heap space
  6. 0

    the log: [08/24/11 13:36:28] [SSH] Opening SSH connection to 10.0.0.172:22. [08/24/11 13:36:28] [SSH] Authenticating as jenkins with /var/lib/jenkins/.ssh/id_rsa. [08/24/11 13:36:28] [SSH] Authentication successful. [08/24/11 13:36:28] [SSH] The remote users environment is: BASH=/bin/bash BASHOPTS=cmdhist:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath BASH_ALIASES=() BASH_ARGC=() BASH_ARGV=() BASH_CMDS=() BASH_EXECUTION_STRING=set BASH_LINENO=() BASH_SOURCE=() BASH_VERSINFO=([0]="4" [1]="2" [2]="8" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu") BASH_VERSION='4.2.8(1)-release' DIRSTACK=() EUID=1001 GROUPS=() HOME=/home/jenkins HOSTNAME=jasmine HOSTTYPE=x86_64 IFS=$' \t\n' LANG=en_US.UTF-8 LOGNAME=jenkins MACHTYPE=x86_64-pc-linux-gnu MAIL=/var/mail/jenkins OPTERR=1 OPTIND=1 OSTYPE=linux-gnu PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games PIPESTATUS=([0]="0") PPID=2225 PS4='+ ' PWD=/home/jenkins SHELL=/bin/bash SHELLOPTS=braceexpand:hashall:interactive-comments SHLVL=1 SSH_CLIENT='10.0.0.61 58049 22' SSH_CONNECTION='10.0.0.61 58049 10.0.0.172 22' TERM=dumb UID=1001 USER=jenkins XDG_SESSION_COOKIE=1efab6c78ed99d8f60f23b1200000004-1314185788.699084-472866313 _=']' [08/24/11 13:36:29] [SSH] Checking java version of java Couldn't figure out the Java version of java bash: java: command not found [08/24/11 13:36:29] [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/24/11 13:36:29] [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/24/11 13:36:29] [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/24/11 13:36:29] [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/24/11 13:36:29] [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/24/11 13:36:29] [SSH] Checking java version of /home/jenkins/jdk/bin/java Couldn't figure out the Java version of /home/jenkins/jdk/bin/java bash: /home/jenkins/jdk/bin/java: No such file or directory Linux jasmine 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux Installing JDK jdk-6u16-oth-JPR@CDS-CDS_Developer Downloading JDK from http://download.oracle.com/otn-pub/java/jdk/6u16-b01//jdk-6u16-linux-x64.bin ERROR: Unexpected error in launching a slave. This is probably a bug in Jenkins. java.lang.OutOfMemoryError: Java heap space at org.apache.commons.io.output.ByteArrayOutputStream.needNewBuffer(ByteArrayOutputStream.java:128) at org.apache.commons.io.output.ByteArrayOutputStream.write(ByteArrayOutputStream.java:158) at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1026) at org.apache.commons.io.IOUtils.copy(IOUtils.java:999) at org.apache.commons.io.IOUtils.toByteArray(IOUtils.java:218) 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.getPage(WebClient.java:328) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:389) at hudson.tools.JDKInstaller.locate(JDKInstaller.java:349) at hudson.plugins.sshslaves.SSHLauncher.attemptToInstallJDK(SSHLauncher.java:345) at hudson.plugins.sshslaves.SSHLauncher.resolveJava(SSHLauncher.java:282) at hudson.plugins.sshslaves.SSHLauncher.launch(SSHLauncher.java:234) 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)

    Jenkins JIRA | 6 years ago | Andreas Lappe
    java.lang.OutOfMemoryError: Java heap space

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.OutOfMemoryError

      Java heap space

      at org.apache.commons.io.output.ByteArrayOutputStream.toByteArray()
    2. Commons IO
      IOUtils.toByteArray
      1. org.apache.commons.io.output.ByteArrayOutputStream.toByteArray(ByteArrayOutputStream.java:271)
      2. org.apache.commons.io.IOUtils.toByteArray(IOUtils.java:219)
      2 frames
    3. HtmlUnit
      HtmlForm.submit
      1. com.gargoylesoftware.htmlunit.WebResponseData.getBody(WebResponseData.java:133)
      2. com.gargoylesoftware.htmlunit.WebResponseData.<init>(WebResponseData.java:86)
      3. com.gargoylesoftware.htmlunit.HttpWebConnection.newWebResponseDataInstance(HttpWebConnection.java:443)
      4. com.gargoylesoftware.htmlunit.HttpWebConnection.makeWebResponse(HttpWebConnection.java:423)
      5. com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:100)
      6. com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1456)
      7. com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1387)
      8. com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1513)
      9. com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1387)
      10. com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1513)
      11. com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1387)
      12. com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1513)
      13. com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1387)
      14. com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1513)
      15. com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1387)
      16. com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:328)
      17. com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:357)
      18. com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:196)
      18 frames
    4. Hudson
      JDKInstaller.locate
      1. hudson.tools.JDKInstaller.locate(JDKInstaller.java:388)
      1 frame
    5. hudson.plugins.sshslaves
      SSHLauncher.launch
      1. hudson.plugins.sshslaves.SSHLauncher.attemptToInstallJDK(SSHLauncher.java:292)
      2. hudson.plugins.sshslaves.SSHLauncher.resolveJava(SSHLauncher.java:228)
      3. hudson.plugins.sshslaves.SSHLauncher.launch(SSHLauncher.java:184)
      3 frames
    6. com.collabnet.hudson
      CubitLauncher.launch
      1. com.collabnet.hudson.CubitLauncher.launch(CubitLauncher.java:70)
      1 frame
    7. Hudson
      SlaveComputer$1.call
      1. hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:199)
      1 frame
    8. Java RT
      Thread.run
      1. java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      2. java.util.concurrent.FutureTask.run(FutureTask.java:138)
      3. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      4. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      5. java.lang.Thread.run(Thread.java:662)
      5 frames