Status Update
Comments
je...@google.com <je...@google.com>
to...@gmail.com <to...@gmail.com> #2
an...@google.com <an...@google.com> #3
to...@gmail.com <to...@gmail.com> #4
ap...@google.com <ap...@google.com> #7
an...@google.com <an...@google.com> #8
to...@gmail.com <to...@gmail.com> #9
Thanks a lot this solve my issue as nothing to save in this case.
For the cases where there's something to save, maybe a first step would be to measure the size and log something when > 500kb or so, to help people figure out the issue and start thinking about the amount of data that can be saved. (I hard an hard time to find the root cause). In all cases crash or data dropping they will need to do something.
to...@gmail.com <to...@gmail.com> #10
So now that I'm playing with the snapshots for the mem leak issue I tested again this and it still crash
java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 1738696 bytes
How can I debug what's inside the bundle?
al...@mercari.com <al...@mercari.com> #11
Is it solved for you?
How can I debug what's inside the bundle?
You can try outState
after super.onSavedInstanceStance(outState)
.
You can see the LazyColumn data putting an entry to each item.
to...@gmail.com <to...@gmail.com> #12
It's not fixed, I generate UUiD for playlist entries now to workaround.
And no unfortunately this does not show up in the normal save states so can't use the normal tools.
ap...@google.com <ap...@google.com> #13
Branch: androidx-main
commit f6318bc2d7aa08b8b840be7a94c36143d8b74840
Author: Andrey Kulikov <andreykulikov@google.com>
Date: Wed Aug 24 20:04:21 2022
Save the states only for the currently visible items of lazy layouts
When we save the state of the screen in cases like navigation to other screen or activity rotation we were saving the state for all items which were ever visible in the lazy layouts like LazyColumn. We want to save state while user is scrolling so they not lose it when they scroll back, however when this screen is not active anymore keeping the states for all items is not efficient as we easily can fill up the whole available limit provided by the Bundle. Instead it could be reasonable to only save states for the items which were visible when the screen state save happens.
Relnote: N/A
Fixes: 240837359
Fixes: 242589959
Fixes: 212982463
Test: added LazyLayoutStateRestorationTest. Removed list and grid specific tests as this logic is specific to LazyLayout and should be tested there
Change-Id: Ic04e855cdaa8d25846c55b5671afe7e8e7337b13
M compose/foundation/foundation/api/restricted_current.txt
D tv/tv-foundation/src/androidTest/java/androidx/tv/foundation/lazy/list/LazyItemStateRestoration.kt
D compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/list/LazyItemStateRestoration.kt
M compose/foundation/foundation/api/1.3.0-beta02.txt
A compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/layout/LazySaveableStateHolder.kt
A compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/layout/LazyLayoutStateRestorationTest.kt
M compose/foundation/foundation/api/public_plus_experimental_1.3.0-beta02.txt
M compose/foundation/foundation/api/public_plus_experimental_current.txt
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/api/restricted_1.3.0-beta02.txt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/layout/LazyLayout.kt
D tv/tv-foundation/src/androidTest/java/androidx/tv/foundation/lazy/grid/LazyItemStateRestoration.kt
D compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/grid/LazyItemStateRestoration.kt
na...@google.com <na...@google.com> #14
This bug was linked in a change in the following release(s):
androidx.compose.foundation:foundation:1.3.0-beta02
cr...@punct.ro <cr...@punct.ro> #15
Since we have a single activity app, it only occurs in background (probably when the user minimizes the app). Most of them are in BinderProxy
android.os.BinderProxy.transactNative (BinderProxy.java)
android.os.BinderProxy.transact (BinderProxy.java:1145)
android.app.IActivityManager$Stub$Proxy.activityStopped (IActivityManager.java:3891)
android.app.servertransaction.PendingTransactionActions$StopInfo.run (PendingTransactionActions.java:144)
android.os.Handler.handleCallback (Handler.java:873)
android.os.Handler.dispatchMessage (Handler.java:99)
android.os.Looper.loop (Looper.java:214)
android.app.ActivityThread.main (ActivityThread.java:7050)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:494)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:965)
and a few occurences with various traces from ActivityThread like:
android.app.ActivityThread.handleSleeping (ActivityThread.java:4540)
android.app.ActivityThread.access$2400 (ActivityThread.java:240)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1896)
android.os.Handler.dispatchMessage (Handler.java:106)
android.os.Looper.loop (Looper.java:214)
android.app.ActivityThread.main (ActivityThread.java:7094)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:494)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:975)
th...@gmail.com <th...@gmail.com> #16
We also see crashes on Android 9 only. I guess this is because of this bug describes over here:
We are actually using BoxWithConstraints
in Lazy Layouts in our app a lot.
zo...@gmail.com <zo...@gmail.com> #17
mi...@lite.tech <mi...@lite.tech> #18
I'm also having the same issue without any BoxWithConstraints
ka...@mercari.com <ka...@mercari.com> #19
Looks like the issue is being handled here
Description
Jetpack Compose release version: 1.1.0-RC01 Kotlin version: 1.6.10
Steps to Reproduce:
LazyColumn
with a large list of large complex itemsitems(playlistItems, { it }) { ... (Anything even a Spacer()) }
(so using large items as keys)Application crash
The crash is not tied to savestates as I log them and they are small in that cases too.
Using smaller keys like System.identityHashCode does workaround the issue, but I suppose this could still happens on even larger lists.
Was quite hard to figure out the cause as 0 information from the crash and nothing in the normal savestates, so fully internal to something happening internally to Compose.