Skip to content

[JENKINS-1283] Remote stdout copier java.lang.OutOfMemoryError: Java heap space #24107

Closed

Description

@jenkins-infra-bot

java.exe -jar hudson-core-1.183.jar longNightlyJob bash -c "Fullbuild.sh"
produces OutOfMemory error:

Exception in thread "Fullbuild.sh: stdout copier" java.lang.OutOfMemoryError:
Java heap space
at java.util.Arrays.copyOf(Unknown Source)
at java.io.ByteArrayOutputStream.write(Unknown Source)
at sun.net.www.http.PosterOutputStream.write(Unknown Source)
at hudson.util.EncodingStream.write(EncodingStream.java:22)
at java.io.FilterOutputStream.write(Unknown Source)
at hudson.util.DualOutputStream.write(DualOutputStream.java:29)
at hudson.util.StreamCopyThread.run(StreamCopyThread.java:28)
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Unknown Source)
at java.io.ByteArrayOutputStream.write(Unknown Source)
at sun.net.www.http.PosterOutputStream.write(Unknown Source)
at sun.nio.cs.StreamEncoder.writeBytes(Unknown Source)
at sun.nio.cs.StreamEncoder.implClose(Unknown Source)
at sun.nio.cs.StreamEncoder.close(Unknown Source)
at java.io.OutputStreamWriter.close(Unknown Source)
at hudson.Main.remotePost(Main.java:99)
at hudson.Main.run(Main.java:40)
at hudson.Main.main(Main.java:26)

It would be nice to have the output buffered into a logfile and transfered to
the Master in pieces. Please, cut the "salami" in slices before eating

P.S. Hudson is great! Definitely: architecture, concepts, plug-ins!


Originally reported by hostlows, imported from: Remote stdout copier java.lang.OutOfMemoryError: Java heap space
  • status: Closed
  • priority: Major
  • component(s): other
  • resolution: Fixed
  • resolved: 2008-02-12T08:17:58+00:00
  • votes: 0
  • watchers: 0
  • imported: 2025-12-08
Raw content of original issue

java.exe -jar hudson-core-1.183.jar longNightlyJob bash -c "Fullbuild.sh" produces OutOfMemory error:

Exception in thread "Fullbuild.sh: stdout copier" java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Unknown Source) at java.io.ByteArrayOutputStream.write(Unknown Source) at sun.net.www.http.PosterOutputStream.write(Unknown Source) at hudson.util.EncodingStream.write(EncodingStream.java:22) at java.io.FilterOutputStream.write(Unknown Source) at hudson.util.DualOutputStream.write(DualOutputStream.java:29) at hudson.util.StreamCopyThread.run(StreamCopyThread.java:28) Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Unknown Source) at java.io.ByteArrayOutputStream.write(Unknown Source) at sun.net.www.http.PosterOutputStream.write(Unknown Source) at sun.nio.cs.StreamEncoder.writeBytes(Unknown Source) at sun.nio.cs.StreamEncoder.implClose(Unknown Source) at sun.nio.cs.StreamEncoder.close(Unknown Source) at java.io.OutputStreamWriter.close(Unknown Source) at hudson.Main.remotePost(Main.java:99) at hudson.Main.run(Main.java:40) at hudson.Main.main(Main.java:26)

It would be nice to have the output buffered into a logfile and transfered to the Master in pieces. Please, cut the "salami" in slices before eating

P.S. Hudson is great! Definitely: architecture, concepts, plug-ins!

  • environment: Platform: All, OS: Windows XP

Activity

  1. jenkins-infra-bot commented on Feb 12, 2008

    @jenkins-infra-bot
    Author
    kohsuke:
    • Original comment link
    • Raw content of original comment:

      Implemented in 1.184.

    Implemented in 1.184.

  2. jenkins-infra-bot commented on Feb 14, 2008

    @jenkins-infra-bot
    Author
    mfriedenhagen:

    Hello,

    looking at:
    http://fisheye5.cenqua.com/changelog/hudson/hudson?cs=MAIN:kohsuke:20080212161656
    the fix uses deleteOnExit, there was a problem with deleteOnExit of tmp-files in older Java-releases, I
    don't know wether this is fixed:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4513817
    If I understand it correctly every build will produce a tmp-file, the list will grow rather rapidly.

    Regards
    Mirko

  3. jenkins-infra-bot commented on Dec 11, 2009

    @jenkins-infra-bot
    Author
    mfriedenhagen:

    The changeset is now available as http://fisheye4.atlassian.com/changelog/hudson?cs=7102

  4. jenkins-infra-bot commented on Dec 11, 2009

    @jenkins-infra-bot
    Author
    mfriedenhagen:

    http://fisheye4.atlassian.com/browse/hudson/trunk/hudson/main/core/src/main/java/hudson/Main.java?r=21479#l113 shows that deleteOnExit is still there, so propably it is still a problem.

    Another bugs refering to this with a solution for JAVA 1.6 is:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4872014
    which references:
    http://www.jroller.com/javabean/entry/solving_an_outofmemoryerror_java_6

  5. jenkins-infra-bot commented on Dec 11, 2009

    @jenkins-infra-bot
    Author
    mfriedenhagen:

    The original bug is gone, however http://issues.jenkins-ci.org/browse/JENKINS-5066 describes that deleteOnExit is evil.

  6. removed
    bugFor changelog: Minor bug. Will be listed after features
    on Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions