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

Hudson loads entire text of log file into heap, 2x

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • ant-plugin
    • None
    • Platform: All, OS: All

      I have a project which was for a while generating 150 Mb log files (due to use
      of ant -v to track down a config problem). With the server running at -Xmx400m,
      I still got OOMEs at the end of the build. By looking at a jhat-format dump, I
      found that the complete text of the log file was present as char[] in Hudson's
      heap... twice!

          [JENKINS-638] Hudson loads entire text of log file into heap, 2x

          Jesse Glick added a comment -

          Unfortunately I could not find any referrering objects in the heap dump.

          Jesse Glick added a comment - Unfortunately I could not find any referrering objects in the heap dump.

          The culprit is Run.getLog().

          There are two offending code. One is in MailSender.java line 170 and the other
          is console.jelly. Both should be easy to fix.

          Would you be willing to fix this? Or do you want me to do it?

          Kohsuke Kawaguchi added a comment - The culprit is Run.getLog(). There are two offending code. One is in MailSender.java line 170 and the other is console.jelly. Both should be easy to fix. Would you be willing to fix this? Or do you want me to do it?

          Jelly side is fixed. The only remaining work is MailSender.

          Kohsuke Kawaguchi added a comment - Jelly side is fixed. The only remaining work is MailSender.

          dwdyer added a comment -

          I'll take a look at fixing this. Changing "assigned to" user to me.

          dwdyer added a comment - I'll take a look at fixing this. Changing "assigned to" user to me.

          dwdyer added a comment -

          Fixed in MailSender.java as well now. Added new method to Run.java that
          returns only the number of lines required by the caller (no point loading the
          whole log just to truncate it).

          dwdyer added a comment - Fixed in MailSender.java as well now. Added new method to Run.java that returns only the number of lines required by the caller (no point loading the whole log just to truncate it).

            dwdyer dwdyer
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: