mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-08-30 11:49:50 +02:00
[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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user