A deep dive into a memory leak investigation in Meilisearch, tracing through multiple suspects: a bumpalo allocator misuse (storing std::Vec inside bumpalo::Vec, preventing drop glue from running), and ultimately a more significant issue with mimalloc v2 failing to cooperate with LMDB's system allocator. The root cause was that LMDB and Meilisearch were using different allocators, causing pages to be allocated and deallocated without being reusable. Switching to a unified allocator (jemalloc or mimalloc v3) resolved the RSS growth. Mimalloc v3 proved especially effective due to improved thread memory sharing and lower memory usage for large workloads, yielding ~13% performance gains in benchmarks.
Sort: