Skip to content

Optimize usage of FileDataSource with AttachmentStorage#23

Open
ganomi wants to merge 2 commits intooblac:masterfrom
ganomi:improve_file_data_source_usage
Open

Optimize usage of FileDataSource with AttachmentStorage#23
ganomi wants to merge 2 commits intooblac:masterfrom
ganomi:improve_file_data_source_usage

Conversation

@ganomi
Copy link
Copy Markdown

@ganomi ganomi commented Dec 26, 2025

Hi @igr,

i was optimizing the memory usage of my application and checking where humongous objects were allocated when processing emails with large attachments.

I was already using a streamed MimeMessage as input and also had configured an attachmentStorage folder. But for each attachment there was still a large byte array beeing allocated. Passing an inputStream to the .content method would always create a byte array.

So i have streamlined the usage of FileDataSource in this MR to have a minimal memory footprint.

Would be great if you could check my changes.

Best Regards
ganomi

@ganomi ganomi requested a review from igr as a code owner December 26, 2025 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant