Expedia Feb 2, 2021

Solving Native Memory Leaks in Mobile Apps

Article Summary

Sid Rathi from Expedia Group debugged a production nightmare: KStream apps dying in an endless OOM loop. The culprit? A single unclosed iterator eating native memory.

Expedia engineers faced a vicious cycle where Kafka Streams applications kept crashing from out-of-memory errors. New instances would spin up, rebalance, then fail again within minutes. The leak wasn't in heap memory, making it exceptionally hard to diagnose.

Key Takeaways

Critical Insight

An unclosed RocksDB iterator caused unbounded native memory growth that horizontal scaling couldn't solve, but proper resource management with try-with-resources fixed permanently.

The article reveals why increasing app instances actually accelerated the memory leak, and shares the specific YourKit profiling technique that finally cracked the case.

Recent from Expedia

Related Articles