java.lang.OutOfMemoryError: Java heap space

Jenkins JIRA | martin naughton | 3 years ago
  1. 0

    I am trying to add to an variable that is already in Jenkins.If i have the following entry in my properties file. PATH = C:\PROGRAM\BIN;$PATH and i check the injectedEnvVars.txt file i see that PATH is set to this PATH=C:\PROGRAM\BIN;C:\PROGRAM\BIN;C:\PROGRAM\BIN;C:\PROGRAM\BIN;C:\PROGRAM\BIN;C:\PROGRAM\BIN;C:\PROGRAM\BIN;C:\PROGRAM\BIN; and so on. IT could be 1000 C:\PROGRAM\BIN; printed in the file making the jenkins build run out of memory. I had a look at the code and it might be where the file is being read. IT might be looping around. This can happen with any variable just not PATH. This will produce the problem also. There is a loop some where that adds the variable to the variable over and over. OS=Windows_NT;$OS This is the exception that is produced by Jenkins. Archiving artifacts FATAL: Java heap space java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:2894) at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:117) at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:407) at java.lang.StringBuilder.append(StringBuilder.java:136) at hudson.Util.replaceMacro(Util.java:160) at hudson.Util.replaceMacro(Util.java:127) at org.jenkinsci.plugins.envinject.service.EnvInjectEnvVars.resolveVars(EnvInjectEnvVars.java:206) at org.jenkinsci.plugins.envinject.EnvInjectListener$2.buildEnvVars(EnvInjectListener.java:211) at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:942) at hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:136) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776) at hudson.model.Build$BuildExecution.post2(Build.java:183) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726) at hudson.model.Run.execute(Run.java:1628) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:247)

    Jenkins JIRA | 3 years ago | martin naughton
    java.lang.OutOfMemoryError: Java heap space
  2. 0

    I am trying to add to an variable that is already in Jenkins.If i have the following entry in my properties file. PATH = C:\PROGRAM\BIN;$PATH and i check the injectedEnvVars.txt file i see that PATH is set to this PATH=C:\PROGRAM\BIN;C:\PROGRAM\BIN;C:\PROGRAM\BIN;C:\PROGRAM\BIN;C:\PROGRAM\BIN;C:\PROGRAM\BIN;C:\PROGRAM\BIN;C:\PROGRAM\BIN; and so on. IT could be 1000 C:\PROGRAM\BIN; printed in the file making the jenkins build run out of memory. I had a look at the code and it might be where the file is being read. IT might be looping around. This can happen with any variable just not PATH. This will produce the problem also. There is a loop some where that adds the variable to the variable over and over. OS=Windows_NT;$OS This is the exception that is produced by Jenkins. Archiving artifacts FATAL: Java heap space java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:2894) at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:117) at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:407) at java.lang.StringBuilder.append(StringBuilder.java:136) at hudson.Util.replaceMacro(Util.java:160) at hudson.Util.replaceMacro(Util.java:127) at org.jenkinsci.plugins.envinject.service.EnvInjectEnvVars.resolveVars(EnvInjectEnvVars.java:206) at org.jenkinsci.plugins.envinject.EnvInjectListener$2.buildEnvVars(EnvInjectListener.java:211) at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:942) at hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:136) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776) at hudson.model.Build$BuildExecution.post2(Build.java:183) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726) at hudson.model.Run.execute(Run.java:1628) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:247)

    Jenkins JIRA | 3 years ago | martin naughton
    java.lang.OutOfMemoryError: Java heap space
  3. 0

    `OutOfMemoryError` in `StringBuilder` and `HashSet`

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

    Automated exception search integrated into your IDE

  5. 0

    Report generation OOME

    GitHub | 2 years ago | isavin
    java.lang.OutOfMemoryError: Java heap space
  6. 0

    OutOfMemoryError when parsing an invalid JSON

    GitHub | 2 years ago | cvrabie
    java.lang.OutOfMemoryError: Java heap space

  1. Handemelindo 2 times, last 1 month ago
  2. Tahir 2 times, last 2 months ago
  3. Tahir 2 times, last 2 months ago
  4. harshg 2 times, last 3 months ago
  5. sunils 1 times, last 5 months ago
3 more registered users
16 unregistered visitors
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 java.util.Arrays.copyOf()
  2. Java RT
    StringBuilder.append
    1. java.util.Arrays.copyOf(Arrays.java:2894)
    2. java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:117)
    3. java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:407)
    4. java.lang.StringBuilder.append(StringBuilder.java:136)
    4 frames
  3. Hudson
    Util.replaceMacro
    1. hudson.Util.replaceMacro(Util.java:160)
    2. hudson.Util.replaceMacro(Util.java:127)
    2 frames
  4. org.jenkinsci.plugins
    EnvInjectListener$2.buildEnvVars
    1. org.jenkinsci.plugins.envinject.service.EnvInjectEnvVars.resolveVars(EnvInjectEnvVars.java:206)
    2. org.jenkinsci.plugins.envinject.EnvInjectListener$2.buildEnvVars(EnvInjectListener.java:211)
    2 frames
  5. Hudson
    Executor.run
    1. hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:942)
    2. hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:136)
    3. hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    4. hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
    5. hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
    6. hudson.model.Build$BuildExecution.post2(Build.java:183)
    7. hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
    8. hudson.model.Run.execute(Run.java:1628)
    9. hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    10. hudson.model.ResourceController.execute(ResourceController.java:88)
    11. hudson.model.Executor.run(Executor.java:247)
    11 frames