PSA to #rustlang and #linux developers: there is a long-standing 20y bug in the system allocator (glibc malloc) which causes it to hoard large sbrk buffers in arenas. By default, it uses heuristics to dynamically increase the mmap threshold—the point where it switches from using sbrk to mmap—which causes a memory "leak". Some #libcosmic apps were affected by this bug, causing them to use 10-30x more memory than they need. See the PR below for how to tame malloc in Rust: