Minimize memory usage by reducing in-memory cover cache size (mihonapp/mihon#2266)

Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
(cherry picked from commit 4c9cfd8da5f9c67daa4b6401a910f979fd79179f)
This commit is contained in:
Luca Auer 2025-12-16 18:08:24 +01:00 committed by Cuong-Tran
parent 36c8f27736
commit a5d8f2efac
No known key found for this signature in database
GPG key ID: 94EFFE320FE7A47C
2 changed files with 9 additions and 6 deletions

View file

@ -11,6 +11,9 @@ The format is a modified version of [Keep a Changelog](https://keepachangelog.co
- `Other` - for technical stuff.
## [Unreleased]
### Improved
- Minimize memory usage by reducing in-memory cover cache size ([@Lolle2000la](https://github.com/Lolle2000la)) ([#2266](https://github.com/mihonapp/mihon/pull/2266))
### Changed
- Delegate Suwayomi tracker authentication to extension ([@cpiber](https://github.com/cpiber)) ([#2476](https://github.com/mihonapp/mihon/pull/2476))

View file

@ -269,12 +269,6 @@ class App : Application(), DefaultLifecycleObserver, SingletonImageLoader.Factor
// SY <--
}
memoryCache(
MemoryCache.Builder()
.maxSizePercent(context, 0.25)
.build(),
)
diskCache(
DiskCache.Builder()
.directory(context.cacheDir.resolve("image_cache"))
@ -282,6 +276,12 @@ class App : Application(), DefaultLifecycleObserver, SingletonImageLoader.Factor
.build(),
)
memoryCache(
MemoryCache.Builder()
.maxSizePercent(context)
.build(),
)
crossfade((300 * this@App.animatorDurationScale).toInt())
allowRgb565(DeviceUtil.isLowRamDevice(this@App))
if (networkPreferences.verboseLogging().get()) logger(DebugLogger())