java.lang.OutOfMemoryError: Java heap space

Jenkins JIRA | Johnathon Sanders | 5 years ago
  1. 0

    On Jenkins startup, an error appears in our logs and one of jobs disappears and never loads again: SEVERE: Failed Loading job [Our Job Name] java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:2746) at java.util.Vector.ensureCapacityHelper(Vector.java:246) at java.util.Vector.addElement(Vector.java:593) at java.util.Stack.push(Stack.java:67) at hudson.maven.MavenModuleSet.onLoad(MavenModuleSet.java:639) at hudson.model.Items.load(Items.java:115) at jenkins.model.Jenkins$14.run(Jenkins.java:2364) at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:146) at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:259) at jenkins.model.Jenkins$5.runTask(Jenkins.java:804) at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:187) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:679) This job was created without errors in Jenkins, and it builds and deploys perfectly fine until we stop and start Jenkins. Once we do that, the error appears in the log and the job never again shows up in the Jenkins UI. All of our other jobs (which are all maven3) load fine. Also I watch the heapSpace allocation in visualVM and after this erring thread dies, the heap space allocation drops right down to normal and the aplication has no trouble running with the heap space allocated. This is true when I run Jenkins without even specifying any java_args. Our build environment has no trouble running with the default jenkins allocations. However, I have set JAVA_ARGS="-Xms512m -Xmx2048m -XX:+HeapDumpOnOutOfMemoryError" and it still errs and produces a heap dump. About the project: - It's a multi-module project (with 2 modules). - It's a maven project being pulled from github - I have tried having nothing other then the github scm link and a mvn deploy command set up on the job, in case it was a random plug-in issue. It still errs on startup. I have another multi-module project that loads just fine in Jenkins. We have only 10 or so total jobs in Jenkins, so it's not exactly an intense build environment. I will attach a link to the hprof as soon as it's done uploading, which should be tomorrow morning.

    Jenkins JIRA | 5 years ago | Johnathon Sanders
    java.lang.OutOfMemoryError: Java heap space
  2. 0

    On Jenkins startup, an error appears in our logs and one of jobs disappears and never loads again: SEVERE: Failed Loading job [Our Job Name] java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:2746) at java.util.Vector.ensureCapacityHelper(Vector.java:246) at java.util.Vector.addElement(Vector.java:593) at java.util.Stack.push(Stack.java:67) at hudson.maven.MavenModuleSet.onLoad(MavenModuleSet.java:639) at hudson.model.Items.load(Items.java:115) at jenkins.model.Jenkins$14.run(Jenkins.java:2364) at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:146) at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:259) at jenkins.model.Jenkins$5.runTask(Jenkins.java:804) at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:187) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:679) This job was created without errors in Jenkins, and it builds and deploys perfectly fine until we stop and start Jenkins. Once we do that, the error appears in the log and the job never again shows up in the Jenkins UI. All of our other jobs (which are all maven3) load fine. Also I watch the heapSpace allocation in visualVM and after this erring thread dies, the heap space allocation drops right down to normal and the aplication has no trouble running with the heap space allocated. This is true when I run Jenkins without even specifying any java_args. Our build environment has no trouble running with the default jenkins allocations. However, I have set JAVA_ARGS="-Xms512m -Xmx2048m -XX:+HeapDumpOnOutOfMemoryError" and it still errs and produces a heap dump. About the project: - It's a multi-module project (with 2 modules). - It's a maven project being pulled from github - I have tried having nothing other then the github scm link and a mvn deploy command set up on the job, in case it was a random plug-in issue. It still errs on startup. I have another multi-module project that loads just fine in Jenkins. We have only 10 or so total jobs in Jenkins, so it's not exactly an intense build environment. I will attach a link to the hprof as soon as it's done uploading, which should be tomorrow morning.

    Jenkins JIRA | 5 years ago | Johnathon Sanders
    java.lang.OutOfMemoryError: Java heap space
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Why do I get a java.lang.OutOfMemoryError: Java heap space error?

    Stack Overflow | 4 years ago | user1093111
    java.lang.OutOfMemoryError: Java heap space
  5. 0

    OutOfMemory Exception : java heap space

    Google Groups | 6 months ago | deepak singh
    java.lang.OutOfMemoryError: Java heap space* *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 java.util.Arrays.copyOf()
    2. Java RT
      Stack.push
      1. java.util.Arrays.copyOf(Arrays.java:2746)
      2. java.util.Vector.ensureCapacityHelper(Vector.java:246)
      3. java.util.Vector.addElement(Vector.java:593)
      4. java.util.Stack.push(Stack.java:67)
      4 frames
    3. Hudson Maven Embedder
      MavenModuleSet.onLoad
      1. hudson.maven.MavenModuleSet.onLoad(MavenModuleSet.java:639)
      1 frame
    4. Hudson
      Items.load
      1. hudson.model.Items.load(Items.java:115)
      1 frame
    5. jenkins.model
      Jenkins$14.run
      1. jenkins.model.Jenkins$14.run(Jenkins.java:2364)
      1 frame
    6. init
      Reactor.runTask
      1. org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:146)
      2. org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:259)
      2 frames
    7. jenkins.model
      Jenkins$5.runTask
      1. jenkins.model.Jenkins$5.runTask(Jenkins.java:804)
      1 frame
    8. init
      Reactor$Node.run
      1. org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:187)
      2. org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94)
      2 frames
    9. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      3. java.lang.Thread.run(Thread.java:679)
      3 frames