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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: ant-plugin
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      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!

        Attachments

          Activity

          Hide
          jglick Jesse Glick added a comment -

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

          Show
          jglick Jesse Glick added a comment - Unfortunately I could not find any referrering objects in the heap dump.
          Hide
          kohsuke 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?

          Show
          kohsuke 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?
          Hide
          kohsuke Kohsuke Kawaguchi added a comment -

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

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

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

          Show
          dwdyer dwdyer added a comment - I'll take a look at fixing this. Changing "assigned to" user to me.
          Hide
          dwdyer 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).

          Show
          dwdyer 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).

            People

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

              Dates

              Created:
              Updated:
              Resolved: