Conversation
Adds option to switch memory allocator to mimalloc using a feature flag. Disabled by default. Signed-off-by: Jagoda Ślązak <[email protected]>
|
Let's deploy musl version first and see if mimalloc is needed. And if needed, then it could be enabled without the feature flag, we are not going to have options to deploy different versions of malloc on chatmail anyway. Does mimalloc actually build statically with musl target? |
It does |
|
Seems we don't need it, after switch to musl memory is at ~3MB all the time instead of growing to 500 MB and staying there like it was with glibc. |
|
Also some reference about fragmentation: https://kerkour.com/rust-jemalloc There are also some posts about musl libc being slow in heavily threaded apps, but in case of filtermail CPU usage did not increase so it does not matter for our usage: https://nickb.dev/blog/default-musl-allocator-considered-harmful-to-performance/ Does not look like adding dependency is worth it, it may even make filtermail use more than 3MB of memory. |
Adds option to switch memory allocator to mimalloc using a feature flag.
Disabled by default.