[eric] electron: memory pressure now sheds weight (thumbnails pause, caches drop) instead of growing until macOS kills the app (ENG-320)

This commit is contained in:
ciregenz
2026-08-16 00:31:54 -07:00
parent 7258c1a2d4
commit 7d9fe3dc94
5 changed files with 134 additions and 0 deletions
+2
View File
@@ -43,6 +43,8 @@ function startMemorySensor(app, getMainWindow) {
let metrics;
try { metrics = app.getAppMetrics(); } catch (_) { return; }
const mb = totalMb(metrics);
// Detection without action is how sessions climbed to 4GB and died silently; relief acts on the same sample.
try { require('./memoryRelief').updateMemoryPressure(mb, TOTAL_MB_CAP); } catch (_) {}
p_history.push(mb);
if (p_history.length > GROWTH_WINDOW) p_history.shift();
const slope = slopeMbPerMin(p_history);