commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Pummer (Updated) (JIRA)" <>
Subject [jira] [Updated] (EMAIL-110) java.lang.OutOfMemoryError: Java heap space while parsing Mime part
Date Fri, 13 Jan 2012 09:57:39 GMT


Thomas Pummer updated EMAIL-110:

    Attachment: EMAIL-110.patch

New MimeMessageParser test to verify that it can parse the eml file without getting OOM.
Reproduced an other eml file with the same defect, tested with the Maven project given by
Stephen Kruger to ensure that the OOM error occures with it too.

The eml file is corrupt, as mentioned in my comment above. So the MimeMessageParser cannot
detect any attachment within it. 
As an other example, Outlook Express cannot read it too. It shows the Attachment with a size
of 0 Bytes
> java.lang.OutOfMemoryError: Java heap space while parsing Mime part
> -------------------------------------------------------------------
>                 Key: EMAIL-110
>                 URL:
>             Project: Commons Email
>          Issue Type: Bug
>    Affects Versions: 1.2
>         Environment: Windows, Linux
>            Reporter: Stephen Kruger
>            Assignee: Siegfried Goeschl
>            Priority: Blocker
>         Attachments: EMAIL-110.patch,, crashfix.eml
> 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(
> 	at
> 	at javax.mail.internet.MimeMultipart.readTillFirstBoundary(
> 	at javax.mail.internet.MimeMultipart.parse(
> 	at javax.mail.internet.MimeMultipart.updateHeaders(
> 	at javax.mail.internet.MimeBodyPart.updateHeaders(
> 	at javax.mail.internet.MimeMultipart.updateHeaders(
> 	at javax.mail.internet.MimeMessage.updateHeaders(
> 	at javax.mail.internet.MimeMessage.saveChanges(
> 	at javax.mail.Transport.send(
> 	at javax.mail.Transport.send(
> 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

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message