java.lang.OutOfMemoryError: Java heap space

Jenkins JIRA | Jesse Glick | 4 years ago
  1. 0

    A user with some {{*-output.txt}} files pushing 70Mb received errors when publishing test results: {code:none} [ERROR] FATAL ERROR [INFO] ------------------------------------------------------------------------ [INFO] Java heap space [INFO] ------------------------------------------------------------------------ [INFO] Trace java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:2882) at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100) at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:515) at java.lang.StringBuffer.append(StringBuffer.java:306) at java.io.StringWriter.write(StringWriter.java:77) at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1129) at org.apache.commons.io.IOUtils.copy(IOUtils.java:1104) at org.apache.commons.io.IOUtils.copy(IOUtils.java:1050) at org.apache.commons.io.IOUtils.copy(IOUtils.java:1075) at org.apache.commons.io.IOUtils.toString(IOUtils.java:382) at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1103) at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1120) at hudson.tasks.junit.SuiteResult.<init>(SuiteResult.java:195) at hudson.tasks.junit.SuiteResult.parseSuite(SuiteResult.java:130) at hudson.tasks.junit.SuiteResult.parse(SuiteResult.java:115) at hudson.tasks.junit.TestResult.parse(TestResult.java:227) at hudson.tasks.junit.TestResult.parse(TestResult.java:163) at hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:141) at hudson.maven.Maven2Builder.postExecute(Maven2Builder.java:155) at hudson.maven.MavenBuilder$Adapter.postExecute(MavenBuilder.java:310) at hudson.maven.agent.PluginManagerInterceptor$1MojoIntercepterImpl.callPost(PluginManagerInterceptor.java:170) at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java:183) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:65) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) [INFO] ------------------------------------------------------------------------ [INFO] ... [INFO] Final Memory: 223M/1224M [INFO] ------------------------------------------------------------------------ {code} Indeed it is silly to call {{FileUtils.readFileToString}} only to throw away the great majority of what was just read.

    Jenkins JIRA | 4 years ago | Jesse Glick
    java.lang.OutOfMemoryError: Java heap space
  2. 0

    A user with some {{*-output.txt}} files pushing 70Mb received errors when publishing test results: {code:none} [ERROR] FATAL ERROR [INFO] ------------------------------------------------------------------------ [INFO] Java heap space [INFO] ------------------------------------------------------------------------ [INFO] Trace java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:2882) at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100) at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:515) at java.lang.StringBuffer.append(StringBuffer.java:306) at java.io.StringWriter.write(StringWriter.java:77) at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1129) at org.apache.commons.io.IOUtils.copy(IOUtils.java:1104) at org.apache.commons.io.IOUtils.copy(IOUtils.java:1050) at org.apache.commons.io.IOUtils.copy(IOUtils.java:1075) at org.apache.commons.io.IOUtils.toString(IOUtils.java:382) at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1103) at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1120) at hudson.tasks.junit.SuiteResult.<init>(SuiteResult.java:195) at hudson.tasks.junit.SuiteResult.parseSuite(SuiteResult.java:130) at hudson.tasks.junit.SuiteResult.parse(SuiteResult.java:115) at hudson.tasks.junit.TestResult.parse(TestResult.java:227) at hudson.tasks.junit.TestResult.parse(TestResult.java:163) at hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:141) at hudson.maven.Maven2Builder.postExecute(Maven2Builder.java:155) at hudson.maven.MavenBuilder$Adapter.postExecute(MavenBuilder.java:310) at hudson.maven.agent.PluginManagerInterceptor$1MojoIntercepterImpl.callPost(PluginManagerInterceptor.java:170) at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java:183) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:65) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) [INFO] ------------------------------------------------------------------------ [INFO] ... [INFO] Final Memory: 223M/1224M [INFO] ------------------------------------------------------------------------ {code} Indeed it is silly to call {{FileUtils.readFileToString}} only to throw away the great majority of what was just read.

    Jenkins JIRA | 4 years ago | Jesse Glick
    java.lang.OutOfMemoryError: Java heap space
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Hibernate remove outOfMemory

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

    6 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
      StringWriter.write
      1. java.util.Arrays.copyOf(Arrays.java:2882)
      2. java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
      3. java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:515)
      4. java.lang.StringBuffer.append(StringBuffer.java:306)
      5. java.io.StringWriter.write(StringWriter.java:77)
      5 frames
    3. Commons IO
      FileUtils.readFileToString
      1. org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1129)
      2. org.apache.commons.io.IOUtils.copy(IOUtils.java:1104)
      3. org.apache.commons.io.IOUtils.copy(IOUtils.java:1050)
      4. org.apache.commons.io.IOUtils.copy(IOUtils.java:1075)
      5. org.apache.commons.io.IOUtils.toString(IOUtils.java:382)
      6. org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1103)
      7. org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1120)
      7 frames
    4. Hudson
      TestResult.parse
      1. hudson.tasks.junit.SuiteResult.<init>(SuiteResult.java:195)
      2. hudson.tasks.junit.SuiteResult.parseSuite(SuiteResult.java:130)
      3. hudson.tasks.junit.SuiteResult.parse(SuiteResult.java:115)
      4. hudson.tasks.junit.TestResult.parse(TestResult.java:227)
      5. hudson.tasks.junit.TestResult.parse(TestResult.java:163)
      5 frames
    5. Legacy Maven 2 job type Plugin
      SurefireArchiver.postExecute
      1. hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:141)
      1 frame
    6. Hudson Maven Embedder
      MavenBuilder$Adapter.postExecute
      1. hudson.maven.Maven2Builder.postExecute(Maven2Builder.java:155)
      2. hudson.maven.MavenBuilder$Adapter.postExecute(MavenBuilder.java:310)
      2 frames
    7. Hudson M2
      PluginManagerInterceptor.executeMojo
      1. hudson.maven.agent.PluginManagerInterceptor$1MojoIntercepterImpl.callPost(PluginManagerInterceptor.java:170)
      2. hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java:183)
      2 frames
    8. Maven Core
      DefaultMaven.execute
      1. org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
      2. org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
      3. org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
      4. org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
      5. org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
      6. org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
      7. org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:65)
      8. org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
      9. org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
      9 frames
    9. M3 Interceptor
      MavenCli.main
      1. org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
      1 frame