Reducing FOOMs in the Facebook iOS app
Article Summary
Meta's iOS team faced a silent killer: crashes that left no trace, no stack trace, no clue. Just frustrated users and a mystery to solve.
Facebook's engineering team documented how they identified and reduced FOOMs (foreground out-of-memory events) in their iOS app. These crashes are invisible to traditional crash reporting because iOS simply terminates the app when memory runs out, leaving developers blind to the problem.
Key Takeaways
- Tracked six restart reasons to isolate OOMs through process of elimination
- Migrating from UIWebView to WKWebView dramatically reduced memory footprint
- Eliminating temporary 30MB allocations improved reliability by 30 percent
- Built custom C++ allocation tracker to monitor Objective-C object counts
- Automated regression detection using CT-Scan infrastructure for memory tracking
Critical Insight
Systematic measurement and targeted fixes (WebView migration, allocation pattern changes) significantly decreased OOMs and user-reported crashes.