Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.5
-
None
Description
Found
Hello.
OOM occurred in the mail service developed using Apache-commons-email.
I debugged and found that the mail lookup function was wasting memory!
Problem
Below is a test for reproducing the problem.
@Test void memoryTest() throws Exception { FileInputStream is = new FileInputStream("/test/oom.eml"); Session session = Session.getInstance(System.getProperties()); MimeMessage mimeMessage = new MimeMessage(session, is); MimeMessageParser parser = new MimeMessageParser(mimeMessage).parse(); }
Below is the memory usage.
I was thinking of using Attachments as a buffer for OutputStream when I really need them.
However, it is becoming a problem by putting all bytes[] in memory.
Thanks.
Attachments
Issue Links
- causes
-
EMAIL-209 InputStreamDataSource#getInputStream() violates javax.activation.DataSource contract
- Open
- links to