Opened 4 years ago

Closed 23 months ago

#1668 closed defect (fixed)

SUSIMAIL craps out when sending 20MB attachement.

Reported by: c0re Owned by: zzz
Priority: major Milestone: 0.9.33
Component: apps/susimail Version: 0.9.22
Keywords: susimail heap attachement difficult Cc:
Parent Tickets: Sensitive: no

Description

First time I try SUSIMAIL so I have no reference.
Error when sending empty mail with 20MB file attachement (.pdf)
Tried to include text. No difference, same result:

HTTP ERROR 500

Problem accessing /susimail/susimail. Reason:

Server Error

Caused by:

java.lang.OutOfMemoryError?: Java heap space


EOF

Subtickets

Change History (4)

comment:1 Changed 4 years ago by zzz

Version: 0.9.22

if there was a stack trace output, please include it here

comment:2 Changed 4 years ago by zzz

Keywords: difficult added
Milestone: undecidedeventually

Everything is on the heap. If we have the full body, we read it from disk even if headerOnly is true in PersistentMailCache?.locked_getMail().

Mail, MailPart?, Readbuffer, and the decoders keep everything in Strings and byte[]. Both encoded and decoded versions may be in memory simultaneously. There's no input/output streams anywhere.

There is a length check (16 MB) and oom catch in PersistentMailCache?.read() but that's simplistic.

It's the legacy of a (originally) very simple webmail program that needs a lot of work.

comment:3 Changed 23 months ago by zzz

Owner: set to zzz
Status: newaccepted

Fixes for #2109 makes this possible to fix too.
Made additional changes to store sent attachments on disk, never in-memory, in 9f4b1a1184a0e4335f1f823739d15b920d0aa5d7 0.9.32-13
Keeping attachments out of memory on the receive side is much harder, leaving this ticket open for that.
Also, more changes coming to check max size.

comment:4 Changed 23 months ago by zzz

Milestone: eventually0.9.33
Resolution: fixed
Status: acceptedclosed

More max size checks in 0.9.32-14.
Changed my mind, will close this ticket for the sending side, and open new ticket #2119 for receiving side.

Note: See TracTickets for help on using tickets.