[Android] Reduce number of items loaded in RAM

Geoffrey Métais git at videolan.org
Mon Jan 27 06:53:00 CET 2020


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Jan 24 16:23:37 2020 +0100| [014f2e81d18340de58ce10c012d9f0e9e8c39e63] | committer: Nicolas Pomepuy

Reduce number of items loaded in RAM

MEDIALIBRARY_PAGE_SIZE is currently set to 500

This is enough for initial load, 1500 is too much

> https://code.videolan.org/videolan/vlc-android/commit/014f2e81d18340de58ce10c012d9f0e9e8c39e63
---

 .../org/videolan/vlc/providers/medialibrary/MedialibraryProvider.kt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/providers/medialibrary/MedialibraryProvider.kt b/application/vlc-android/src/org/videolan/vlc/providers/medialibrary/MedialibraryProvider.kt
index 560568301..43a6c02b8 100644
--- a/application/vlc-android/src/org/videolan/vlc/providers/medialibrary/MedialibraryProvider.kt
+++ b/application/vlc-android/src/org/videolan/vlc/providers/medialibrary/MedialibraryProvider.kt
@@ -29,8 +29,8 @@ import androidx.paging.toLiveData
 import kotlinx.coroutines.CompletableDeferred
 import org.videolan.medialibrary.interfaces.Medialibrary
 import org.videolan.medialibrary.media.MediaLibraryItem
-import org.videolan.resources.util.HeaderProvider
 import org.videolan.resources.MEDIALIBRARY_PAGE_SIZE
+import org.videolan.resources.util.HeaderProvider
 import org.videolan.tools.Settings
 import org.videolan.vlc.util.ModelsHelper
 import org.videolan.vlc.util.SortModule
@@ -63,8 +63,8 @@ abstract class MedialibraryProvider<T : MediaLibraryItem>(val context: Context,
             pageSize = MEDIALIBRARY_PAGE_SIZE,
             prefetchDistance = MEDIALIBRARY_PAGE_SIZE / 5,
             enablePlaceholders = true,
-            initialLoadSizeHint = MEDIALIBRARY_PAGE_SIZE *3,
-            maxSize = MEDIALIBRARY_PAGE_SIZE *3
+            initialLoadSizeHint = MEDIALIBRARY_PAGE_SIZE,
+            maxSize = MEDIALIBRARY_PAGE_SIZE *2
     )
 
     val pagedList = MLDatasourceFactory().toLiveData(pagingConfig)



More information about the Android mailing list