From d59b61e8102f34c8c55940149ec456d1b5e08d41 Mon Sep 17 00:00:00 2001 From: ciregenz Date: Fri, 7 Aug 2026 00:16:10 -0700 Subject: [PATCH] [eric] telemetry: memory thresholds are env-overridable so support and tests can prove the wire --- electron/memorySensor.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/electron/memorySensor.js b/electron/memorySensor.js index 88b7f572..d0402406 100644 --- a/electron/memorySensor.js +++ b/electron/memorySensor.js @@ -3,10 +3,12 @@ // crossings, so a healthy session ships nothing at all. 'use strict'; -const SAMPLE_MS = 60_000; +// Overridable so support can ask a user to run with a tighter cap, and so the wire is testable +// without allocating gigabytes on someone's machine. +const SAMPLE_MS = Number(process.env.OSW_MEM_SAMPLE_MS || 60_000); // Crossed once, reported once: a leak is a trend, not a per-minute alarm. -const TOTAL_MB_CAP = 3000; -const GROWTH_MB_PER_MIN = 40; +const TOTAL_MB_CAP = Number(process.env.OSW_MEM_CAP_MB || 3000); +const GROWTH_MB_PER_MIN = Number(process.env.OSW_MEM_GROWTH_MB || 40); const GROWTH_WINDOW = 10; let p_timer = null;