-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EMAIL-207] Modify createDataSource method to use AttachmentDataSource #159
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@violetbeach
Thank you for your PR.
- All new public and protected elements should have a Javadoc comment
- All new and changed code should have a matching unit test
Thank very much! I added Javadoc comments on public and protected elements. And I added a unit test for new class. But, i could not cover the changed createDataSource method of MimeMessageParser because it is a difficult area to test. Please let me know if there's anything missing! Thank you. |
Codecov Report
@@ Coverage Diff @@
## master #159 +/- ##
============================================
+ Coverage 65.87% 66.03% +0.16%
- Complexity 305 309 +4
============================================
Files 18 19 +1
Lines 1052 1057 +5
Branches 138 137 -1
============================================
+ Hits 693 698 +5
Misses 280 280
Partials 79 79
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -0,0 +1,104 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! It's almost the same.
Tests InputStreamDataSource based on patch #159 from Lee Jaeheon and modified
Hello @violetbeach |
Hello @garydgregory I've verified that the issue has been solved! Memory is much cleaner, and the parser no longer puts the entire data in the file into memory. Thank you. 👍 |
Issue
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.
Below is the memory usage.
I expected to write attachments to the buffer of the output stream when absolutely necessary.
However, it is becoming a problem by putting all bytes[] in memory.
Sugest
So i modified these processes to use AttachmentDataSource.
Attachment DataSource uses InputStream from original DataSource to ensure memory is not wasted.
As a result, i can get a big effect in memory usage.
If you need the tested eml file, I will send it to you by email.
Thanks very much. 🙇