There seems to be a memory leak in `AnimatedConten...
# compose
m
There seems to be a memory leak in
AnimatedContent
.
AnimatedContent.kt
has
internal val targetSizeMap = mutableScatterMapOf<S, State<IntSize>>()
which grows indefinitely as animations happen and is not cleared. I did a heap dump of my application and the
targetSizeMap
takes 420MB of RAM (after many thousands animations). Is this a known issue? Am I potentially doing something wrong?
r
Looks like the content is only removed from a
DisposableEffect
You should file a bug (cc @Doris Liu)
m
https://issuetracker.google.com/issues/434155455 I'm assuming this is the cause of this existing bug report, so I won't open a new one.
r
Seems like the same thing yeah
t
OMG, thanks for posting here, just probable cause of the random I could not find a reason OOM on crashlytics.
m
Well, I fixed it, hopefully I can remove these copies in a not too far future Compose update.