jodd-mail icon indicating copy to clipboard operation
jodd-mail copied to clipboard

Optimize usage of FileDataSource with AttachmentStorage

Open ganomi opened this issue 4 months ago • 0 comments

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 avatar Dec 26 '25 08:12 ganomi