tcmalloc success

DEC 08, 2006
Domas Mituzas, a MySQL employee and Wikipedia hacker, just posted a great writeup of his recent experience using tcmalloc (an open source Google perftool) to debug some nasty memory leaks:
"Once we started profiling libc, one of initial assumptions appeared to be true - our heap was awfully fragmented, slowing down malloc()."

"Here comes our steroids part: Google has developed a drop-in malloc replacement, tcmalloc, that is really efficient. Space efficient, cpu efficient, lock efficient. This is probably the most-used (and sophisticated) libc function, that was suffering performance issues that not many people wanted to actually tackle. The description sounded really nice, so we ended up using it for our suffering Squids."

"The results were what we expected - awesome :) Now the nice part is that the library is optimized for multi-threaded applications, doing lots of allocations for small objects without too much of lock contention, and uses spinlocks for large allocations. MySQL exactly fits the definition, so just by using simple drop-in replacement you may achieve increased performance over standard libc implementations."

Domas' blog has further details.