Battling Memory Leaks: Tales from the Trenches at WhatsApp
summary
WhatsApp describes concrete fixes and diagnostics: they run per-second instrumentation written to file, a memory outlier detector that dumps state or forces GC, and an external monitor that kills BEAM to capture crash dumps; a custom crash-dump parser surfaces a single process holding ~4 GB and a 600 MB binary. They inspect allocators and supercarrier snapshots via recon_alloc/system_info and a reverse-engineered function, replace malloc with GMO J Malo to cut fragmentation (and ~5% CPU) and avoid OOMs, and apply limits like max heap size and aggressive GC.
AI-written summary · about
chapters (10)
- 0:00Memory leaks at WhatsApp
- 3:40Memory 101 for Erlang
- 7:37Identifying leaks with telemetry
- 17:13Parallelizing requests patterns
- 20:42Allocators and super carriers deep dive
- 31:20Troubleshooting allocator fragmentation
- 38:57Key takeaways
- 39:22Q&A on monitoring tools
- 40:48Q&A on super carrier config
- 42:13Q&A on memory strategies
related talks
01h 07mInside memory management on the BEAM
40mDebugging JVM performance issues
46mMeminspect - Kernel memory selection and inspection mechanism
28mMinidump to debug end user device crashes
55mUsing the Valgrind Framework to Build a Persistent Memory Error Detector
33mDigging through the garbage
38mMemory Page-pooling with Auto Refill Feature for Improved Memory Allocati...
43mEfficient and Practical Capturing of Crash Data on Embedded Systems
