matthewrkula/SecretTextView

Performance issue: Frequently GC

Closed this issue · 1 comments

Tks for your nice code first, but...
while running your demo, I found the memory usage like this (tested on Genymotion 2.4 with intel acceleration, x64, android 5.1.0 on nexus 4):
image

Obviously, it's cause by:
image


I have fix that problem, pls see you pull request.
The work I did is:
1, Use a MutableForegroundColorSpan to maintain the foreground color, instead new a ForeGroundColorSpan every time.
2, Change the MutableForegroundColorSpan object's color when needed.

Here is memory usage after my fix(tested on Genymotion 2.4 with intel acceleration, x64, android 5.1.0 on nexus 4):
image

Fixed with c62c38f