SparkleMotion icon indicating copy to clipboard operation
SparkleMotion copied to clipboard

Memory Leak

Open Jonfor opened this issue 9 years ago • 3 comments

I was using the demo included with this repo with the memory monitor open in Android Studios when I noticed that every swipe reduces the memory that is free...and doesn't ever let it go. It seems to allocate .01MB-.02MB per swipe.

I am running the demo on a Nexus 5X running Android 6.0.1.

Jonfor avatar Jan 20 '16 17:01 Jonfor

I think the reason the memory usage is larger as you swipe is that the SparkleViewPagerLayout keeps the animated Views as the pager progresses. New Views get added in as you swipe, and they are not removed when they are offscreen. This is something I've been wanting to fix for a while.

lzanita09 avatar Jan 23 '16 17:01 lzanita09

Perhaps https://stackoverflow.com/questions/13664155/dynamically-add-and-remove-view-to-viewpager will help?

Jonfor avatar Jan 25 '16 16:01 Jonfor

Same problem here

jennymolske avatar Jun 13 '17 11:06 jennymolske