While load testing one of our Rust services at work, we ran into something that took us way longer to figure out than we’d like to admit: memory that shoots up under load and just stays there.
Though glibc is the default allocator and works well for the majority of applications, it can retain significant allocator-owned memory for bursty workloads due to arena reuse, fragmentation, and cached free chunks.
Allocator switch, and this article was mentioned in Lemmy Release v0.19.20 - Reduced Memory Usage
This release significantly reduces memory usage for the Lemmy backend. Metrics on production instances show a reduction up to 10 times. Here you can see the statistics from a few different instances. Read on for a technical explanation below. Note that the change only affects x86, there is no difference on ARM (e.g. Raspberry Pi), see here for details.


