Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-16001

Don't load attachments in memory when sending mails

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 10.11
    • Fix Version/s: 11.0
    • Component/s: Mail
    • Labels:
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      Right now we do:

                  temporaryAttachmentFile =
                      new TemporaryFile(File.createTempFile("attachment", ".tmp", this.temporaryDirectory));
                  fos = new FileOutputStream(temporaryAttachmentFile);
                  fos.write(attachment.getContent());
      

      The call to getContent() loads the attachment content in memory which is not good since it means requiring more memory than needed.

        Attachments

          Activity

            People

            • Assignee:
              vmassol Vincent Massol
              Reporter:
              vmassol Vincent Massol
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: