RetroFed Forum
Your home away from modern life.
Your Rust Service Isn't Leaking — It Could Be the Allocator
Post Reply
AuthorMessage
Kissaki programming.dev Kissaki@programming.dev
Joined: 2023-06-11
Quote

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.

20   Original
Fizz lemmy.nz Fizz@lemmy.nz
Joined: 2023-06-12
#2 · Quote Reply

Great write up. thanks for posting it was an interesting read.

6
ExperimentalGuy programming.dev ExperimentalGuy@programming.dev
Joined: 2023-07-25
#3 · Quote Reply

I've never thought about what swapping out allocators would do in an async environment like that. Very readable and interesting!

2
Post Reply
Back to top