M12.8: the app no longer freezes every 10 s on Windows: the system memory is read in the background

Every 10 seconds the UI thread re-read the system's memory for the cache budgets, and on
Windows that starts PowerShell (`Get-CimInstance Win32_OperatingSystem`) and waits for it:
about a second, sometimes two, during which the whole app froze. The reading now runs on a
background thread (`sysinfo::MemoryWatch`); `Session::memory_tick` takes the last reading and
starts the next one, never waiting. Console programs started for it no longer open a console
window (`CREATE_NO_WINDOW`).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bflatastic
2026-10-05 07:05:17 +07:00
co-authored by Claude Opus 5.5
parent 4b37443481
commit 2d4a0902ea
4 changed files with 77 additions and 5 deletions
+3
View File
@@ -373,6 +373,8 @@ pub struct Session {
/// The last physical-memory reading (Settings ▸ Memory & CPU budgets); `None` = unknown
/// (headless sessions don't query it, see [`Session::memory_tick`]).
pub sys_memory: Option<sysinfo::SysMemory>,
/// Reads the system's memory in the background for [`Session::memory_tick`].
pub memory_watch: sysinfo::MemoryWatch,
/// Switches Affect Nested Comps as last applied (a change empties the layer cache).
pub applied_nested_switches: Option<bool>,
/// Runs renders and analyses off the UI thread where there are no threads (the web app's
@@ -465,6 +467,7 @@ impl Default for Session {
plugin_loader: None,
script_ui: scriptui::ScriptUi::default(),
sys_memory: None,
memory_watch: Default::default(),
applied_nested_switches: None,
offload: None,
offloaded: vec![],