You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use rememberGlidePreloadingData for preload, but we found that it didn't work properly and that memory usage was high.
val preloadingData = rememberGlidePreloadingData(
data = imageList,
preloadImageSize = Size(Target.SIZE_ORIGINAL.toFloat(), Target.SIZE_ORIGINAL.toFloat()),
numberOfItemsToPreload = numberOfItemsToPreload
) { item, requestBuilder ->
// Must call load() to trigger preloading
println("Preload ${item.url}")
requestBuilder.load(item.url)
}
LazyColumn....{
items(preloadingData.size) { index ->
....
Preload not work properly
Because default value numberOfItemsToPreload: Int = DEFAULT_ITEMS_TO_PRELOAD is 10, we expect to load 10 times ahead.
Event println("Preload ${item.url}") is call multiple times, the actual number of network calls is only once. (I use charles proxy to detect it.)
So i think preload not work properly.
is printed. but network request whether it is the first load or the scroll process, only one is loaded at a time.
memory usage is high.
When i use preload code (not work preload), the memory usage is much higher than that does not use preload code.
preload code will increase 60MB memory usage.
The text was updated successfully, but these errors were encountered:
cuichanghao
changed the title
rememberGlidePreloadingData not preload, but use higher memory.
Compose: rememberGlidePreloadingData not preload, but use higher memory.
Apr 15, 2024
We use rememberGlidePreloadingData for preload, but we found that it didn't work properly and that memory usage was high.
Because default value
numberOfItemsToPreload: Int = DEFAULT_ITEMS_TO_PRELOAD
is 10, we expect to load 10 times ahead.Event println("Preload ${item.url}") is call multiple times, the actual number of network calls is only once. (I use charles proxy to detect it.)
So i think preload not work properly.
is printed. but network request whether it is the first load or the scroll process, only one is loaded at a time.
When i use preload code (not work preload), the memory usage is much higher than that does not use preload code.
preload code will increase 60MB memory usage.
But non-preload code will just increase < 30MB。
We use
1.0.0-beta01
And use OkHttp3
Device: Emulator & Android 13.
The text was updated successfully, but these errors were encountered: