Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Cannot Reproduce
-
1.2
-
None
-
None
-
Windows, Linux
Description
I have a particular eml message which appears to cause a complete memory overflow deep within commons-email.
A look at the source code does reveal a suspect "while" loop which appears to never exit properly, and should be rewritten so that bad data could not give us this situation.
The stack trace is :
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2786)
at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:71)
at javax.mail.internet.MimeMultipart.readTillFirstBoundary(MimeMultipart.java:316)
at javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:186)
at javax.mail.internet.MimeMultipart.updateHeaders(MimeMultipart.java:130)
at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:539)
at javax.mail.internet.MimeMultipart.updateHeaders(MimeMultipart.java:133)
at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:1393)
at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:1366)
at javax.mail.Transport.send(Transport.java:76)
at javax.mail.Transport.send(Transport.java:48)
There are many public threads illustrating this same error, but they never pinpoint the code to Commons Email, I'm guessing I'm using the code in a way which exhibits this behaviour :
http://stackoverflow.com/questions/3177092/uploading-to-blobstore-gives-a-java-heap-outofmemoryerror
http://stackoverflow.com/questions/2994031/outofmemoryerror-trying-to-upload-to-blobstore-locally