Open owl-guy opened 1 month ago
@jonathanpeppers FYI
I remember this happening for me in a production app in Xamarin.Forms, circa 2016 as well. But I can't find an issue on this.
We took the approach:
() => true
for repeating animations...CancellationToken
and CancellationTokenSource
like () => cts.Token.IsCancellationRequested
Page
calls CancellationTokenSource.Cancel()
in the appropriate place. OnDisappearing()
seems like a good option.With this in place, does the problem go away?
@jonathanpeppers i will try this out, but the problem is that we have views in our app that act as display screens, which means the user will stay in that view for days or even weeks while it's being animated. Your suggestion will not help for this case.
@owl-guy if you have a more appropriate place to call CancellationTokenSource.Cancel()
, do that. If the animation is not currently on the screen, you should cancel it.
@jonathanpeppers i understand, but our problem arises because the animation is on the screen for a long time. If you leave the view with the animation open long enough, the app will crash because it's running out of memory
It seems to be on all platforms. Just tested with Windows....
This issue has been verified using Visual Studio 17.12.0 Preview 2.1(8.0.82 & 8.0.91 & 8.0.90). Can repro this issue on windows, android and ios platforms.
Description
When creating an animation that repeats, new TweenerAnimation Objects are created continuously, filling up the app's memory. If you leave it going long enough, the app will crash.
The provided sample repo includes two memory dumps, one was taken after the app was started, the other one after a few minutes. A diff comparison shows an increase in TweenerAnimation objects:
Steps to Reproduce
Link to public reproduction project repository
https://github.com/owl-guy/PerfTest
Version with bug
8.0.91 SR9.1
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS, Android
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
No response