Enhancing Memory Performance in Android TV Applications
summary
A streaming Android TV app used by millions must stay under 200MB RAM limit and initially climbs to ~360–400MB and crashes; reproduction uses an ADB automation script that launches a program and plays video 100 times. LeakCanary identifies a leak in Android’s media/Exo layer so the feature is removed until Google ships a fix, which restores memory. A later problem shows small JS heap but ~150MB native allocations because Hermes doesn’t account native memory; upstream fixes (WeakMap leak and Hermes native memory accounting landed in RN 0.74) and a short‑term periodic JS GC bring the app under limit in production.
AI-written summary · about
chapters (19)
- 0:00Introduction to memory challenges
- 1:21Why React Native for TV apps
- 3:10Reproducing memory spikes
- 7:09Understanding memory leaks
- 8:16Using LeakCanary tool
- 10:05Debugging external dependencies
- 11:31Second memory spike investigation
- 13:17Garbage collector behavior
- 15:28React Native memory architecture
- 18:20Fixing React Native memory issues
- 19:25Debugging memory strategies
- 20:27Conclusion and key takeaways
- 21:09Q&A on TV development challenges
- 22:34Audience questions on memory tools
- 24:00Open source maintenance appreciation
- 25:03Long-term prevention strategies
- 26:07Consistent memory measurement
- 26:53Handling unfixed bugs
- 27:34React Native overhead on TV
