I investigated leaks with RememberLottieComposition and LottieAnimationView, initially thinking that we might need to stop listening to LottieTask when a view or composition gets detached / removed.
However, after looking at a heap dump, I realized that the LottieTask was actually finished. It had delivered its result so it didn't have any reason to stay in memory.
This moved my suspicion to SynchronousQueue as Android has had issues with queues & worker threads on several occasions (see code for details).
Also updated the cached thread pool to create threads named "lottie".
I investigated leaks with
RememberLottieComposition
andLottieAnimationView
, initially thinking that we might need to stop listening to LottieTask when a view or composition gets detached / removed.However, after looking at a heap dump, I realized that the LottieTask was actually finished. It had delivered its result so it didn't have any reason to stay in memory.
This moved my suspicion to SynchronousQueue as Android has had issues with queues & worker threads on several occasions (see code for details).
Also updated the cached thread pool to create threads named "lottie".
Leaks: