commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Kruger (Commented) (JIRA)" <>
Subject [jira] [Commented] (EMAIL-110) java.lang.OutOfMemoryError: Java heap space while parsing Mime part
Date Sun, 11 Dec 2011 15:48:40 GMT


Stephen Kruger commented on EMAIL-110:

The test mail I'm trying to send is way too  small to warrant increasing heap space. It's
definitely a loop termination problem where it's looking for some termination chars which
are not there (perhaps erroneously on the part of the test mail).

I've attached a simple Eclipse project (Maven based) which recreates the problem entirely.
My apologies if the issue turns out to be in one of the other dependencies - since you all
use javax.mail it's hard to understand whose implementation is actually being used.
> 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
>            Priority: Blocker
>         Attachments:, 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