Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-1283

Remote stdout copier java.lang.OutOfMemoryError: Java heap space

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • other
    • None
    • Platform: All, OS: Windows XP

      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!

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

          Implemented in 1.184.

          Kohsuke Kawaguchi added a comment - Implemented in 1.184.

          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

          Mirko Friedenhagen added a comment - 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

          Mirko Friedenhagen added a comment - The changeset is now available as http://fisheye4.atlassian.com/changelog/hudson?cs=7102

          Mirko Friedenhagen added a comment - 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

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

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

            Unassigned Unassigned
            hostlows hostlows
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: