Your Rust Service Isn't Leaking — It Could Be the Allocator
11 points by robey
11 points by robey
Old-timers will be unsurprised that it's hard to get 100% memory efficiency, but I was interested to see how each allocator behaved differently over time, and that jemalloc is apparently doing something that mimalloc is not.
Yeah the behaviour of mimalloc is pretty (in)famous
There are workarounds (e.g. ensuring every thread either allocates once in a while or has a mi_collect call on a heartbeat), but it's pretty unfriendly to work-stealing schedulers, and if you're not aware of the issue it's going to be surprising. It's easier to diagnose and work around than glibc's behaviour, but not amazing.
I wonder how snmalloc compares. I might test it later this week when I have time.