leahneukirchen / mblaze

Unix utilities to deal with Maildir
Other
419 stars 48 forks source link

mthread: reduce memory usage #222

Closed julianrother closed 2 years ago

julianrother commented 2 years ago

mthread keeps header data of all messages in memory until it exits without ever using it. With this change it frees the header data of each message right after processing it.

With my test data of ~100000 messages (10GB) passed to mthread with -S this change reduces the peak memory usage from 841MB to 27MB.

leahneukirchen commented 2 years ago

Very good catch, this is a left-over from the previous codebase I extracted mthread from. :)