From 00be2d4255fe42b0696034cfd108508d5f6ed237 Mon Sep 17 00:00:00 2001 From: brennanb2025 Date: Wed, 24 Jun 2026 12:51:15 -0700 Subject: [PATCH] Harden lazy reload restart guard Co-authored-by: Orca --- src/renderer/src/lib/crash-diagnostics.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/renderer/src/lib/crash-diagnostics.ts b/src/renderer/src/lib/crash-diagnostics.ts index 8477a411678..588e8aefef3 100644 --- a/src/renderer/src/lib/crash-diagnostics.ts +++ b/src/renderer/src/lib/crash-diagnostics.ts @@ -6,6 +6,8 @@ import { getBrowserWebviewMemoryProfile } from '../components/browser-pane/webvi const RENDERER_MEMORY_SAMPLE_INTERVAL_MS = 60_000 const BYTES_PER_MEGABYTE = 1024 * 1024 +// Why: recover only after sustained high heap usage, avoiding reloads for small +// heaps or one-off spikes while still acting before likely renderer loss. const CRITICAL_HEAP_USAGE_RATIO = 0.85 const CRITICAL_HEAP_MIN_MB = 512 const CRITICAL_HEAP_SAMPLES_BEFORE_RELOAD = 2