revert: desktop image eviction threshold to 1.5GB

This commit is contained in:
edde746
2026-04-25 17:12:17 +02:00
parent 23d958fac8
commit 7aaa373bdf
+6 -3
View File
@@ -418,8 +418,8 @@ class _MainAppState extends State<MainApp> with WidgetsBindingObserver {
if (PlatformDetector.isDesktopOS()) {
_memoryCheckTimer = Timer.periodic(const Duration(seconds: 30), (_) {
final rss = ProcessInfo.currentRss;
if (rss > 1024 * 1024 * 1024) {
// 1GB
if (rss > 1536 * 1024 * 1024) {
// 1.5GB
appLogger.w('RSS high ($rss bytes), evicting image caches');
_evictImageCaches();
}
@@ -593,7 +593,10 @@ class _MainAppState extends State<MainApp> with WidgetsBindingObserver {
// SQLite WAL mode handles process death; desktop uses onExitRequested.
InAppReviewService.instance.endSession();
if (PlatformDetector.isDesktopOS()) {
_evictImageCaches();
if (ProcessInfo.currentRss > 1024 * 1024 * 1024) {
// 1GB
_evictImageCaches();
}
}
case AppLifecycleState.inactive:
case AppLifecycleState.hidden: