The 5 worst bugs I've seen on production - #5 the animation memory leak
Published about 1 month ago

This bug lived in the long tail. We had shipped a mobile self‑help app with long user sessions. Most cards were simple text or small forms, but some included Lottie animations (a JSON‑based vector animation format rendered via libraries). In quick development sessions everything looked fine. Only when someone used the app for a full run did the issue appear.
What is it?
A memory leak happens when an application keeps memory it no longer needs, so usage grows over time. Long sessions make leaks visible because the app never gets a chance to reset. See: Memory leak (Wikipedia).
Lottie is a lightweight animation format (JSON) created by Airbnb that plays vector animations natively on web and mobile via libraries. See: Lottie by Airbnb.
Problem
Animations were not released after navigation. Each animation instance held onto memory that never came back.
Impact
QA noticed that after about 30 minutes the app started to lag. Swipes felt slow and the UI stuttered. Memory snapshots showed that each animation leaked roughly 2MB. After enough cards, the app became unresponsive.
Solution
We changed how animations were handled so they were properly cleaned up after use. The credit goes to QA for finding a bug that regular short sessions did not reveal.
Lesson learned: long sessions reveal leaks. Test for the full journey, and verify with memory tools instead of feel.