From 3b6b390f681b7d162318456a0cc6929855011f06 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Mon, 5 Oct 2026 07:25:01 +0700 Subject: [PATCH] M12.8: read the system memory every 30 s instead of 10 s Each reading starts PowerShell on Windows (in the background since the previous commit); the cache budgets only need to follow memory pressure, not track it closely. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/prefs_live.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/prefs_live.rs b/crates/ui-egui/src/prefs_live.rs index 9e730196..9dd4d639 100644 --- a/crates/ui-egui/src/prefs_live.rs +++ b/crates/ui-egui/src/prefs_live.rs @@ -41,12 +41,13 @@ fn dropped_files(app: &mut EffectcraftApp, ctx: &egui::Context) { } } -/// Re-read the system's free memory every few seconds (cache budgets follow it). +/// Re-read the system's free memory every 30 s (cache budgets follow it; on Windows each +/// reading starts PowerShell in the background, so it isn't done more often). fn memory_watch(app: &mut EffectcraftApp, ctx: &egui::Context) { let now = ctx.input(|i| i.time); let id = egui::Id::new("prefs-memory-watch"); let last = ctx.data(|d| d.get_temp::(id)); - if last.is_some_and(|t| now - t < 10.0) { + if last.is_some_and(|t| now - t < 30.0) { return; } ctx.data_mut(|d| d.insert_temp(id, now));