Home / Companies / Cloudflare / Blog / Post Details
Content Deep Dive

The effect of switching to TCMalloc on RocksDB memory use

Blog post from Cloudflare

Post Details
Company
Date Published
Author
Dmitry Vorobev
Word Count
1,701
Language
English
Hacker News Points
111
Summary

The text discusses the issue of unexpectedly high memory consumption in a distributed configuration system called Quicksilver after migrating its storage engine to RocksDB. It explains that the root cause was the default memory allocator, glibc malloc, which led to significant memory fragmentation and waste due to its design for multithreaded applications. The solution was switching to TCMalloc, a memory allocator designed specifically for multithreading, which improved service memory consumption by almost three times. The post emphasizes the importance of choosing an appropriate memory allocator based on workload requirements to optimize memory usage in long-running applications with multiple threads.