Describe the bug
The lottie-react animations are causing large memory leaks. We use multiple animations on a single page within our application. These animations are routinely unmounted and remounted. This leak eventually causes an out of memory browser crash over the course of several hours while our application is running. There is something within the lottie animation not being cleaned up.
To Reproduce
I've created a project here to reproduce the issue. This example just mounts and unmounts multiple example lottie walking animations.
Open the chrome developer tools and start analyzing the memory
Repeatedly (10+ times) click the "Switch" button
Observe the browser memory continues to climb
I am unable to tell if clicking "Switch" before the animation completely finishes makes a difference. Sometimes if you let the animation complete before clicking "Switch" it looks like the browser will attempt to reclaim that memory, but it is not consistent.
Expected behavior
When a lottie animation unmounts it should cleanup any memory references.
Screenshots
The memory will continuously climb as animations are mounted and unmounted.
Hi @StephenEsser thank you for taking the time to report this and add the necessary details in order for me to reproduce it. I will take care of it tonight.
Describe the bug The lottie-react animations are causing large memory leaks. We use multiple animations on a single page within our application. These animations are routinely unmounted and remounted. This leak eventually causes an out of memory browser crash over the course of several hours while our application is running. There is something within the lottie animation not being cleaned up.
To Reproduce
I've created a project here to reproduce the issue. This example just mounts and unmounts multiple example lottie walking animations.
A gh-deployment is here to reproduce: https://stephenesser.github.io/lottie-memory-leak/
Steps to reproduce the behavior:
I am unable to tell if clicking "Switch" before the animation completely finishes makes a difference. Sometimes if you let the animation complete before clicking "Switch" it looks like the browser will attempt to reclaim that memory, but it is not consistent.
Expected behavior When a lottie animation unmounts it should cleanup any memory references.
Screenshots The memory will continuously climb as animations are mounted and unmounted.