From 43f1fb4283319d9222ae0eee8ef4055b6d7ecc17 Mon Sep 17 00:00:00 2001 From: Jis G Jacob Date: Tue, 12 May 2026 16:10:50 +0530 Subject: [PATCH] Atoll: raise MemoryUsageMonitor threshold to 4 GiB in DEBUG builds The 1 GiB resident-size threshold is reasonable for a release build, but Swift/SwiftUI debug builds plus the AVPlayer-backed Canvas video pipeline and SkyLight overlay windows can easily exceed it during normal Xcode-attached development. The restart-alert dialog firing mid-development is disruptive and not actionable. Keep the 1 GiB safety net on release, raise to 4 GiB in DEBUG so developers running under Xcode aren't interrupted by spurious restart prompts. The poll interval, cooldown, and alert text all stay the same. Signed-off-by: Jis G Jacob --- DynamicIsland/managers/MemoryUsageMonitor.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/DynamicIsland/managers/MemoryUsageMonitor.swift b/DynamicIsland/managers/MemoryUsageMonitor.swift index 34c9898..d03b785 100644 --- a/DynamicIsland/managers/MemoryUsageMonitor.swift +++ b/DynamicIsland/managers/MemoryUsageMonitor.swift @@ -24,7 +24,11 @@ import Darwin final class MemoryUsageMonitor { static let shared = MemoryUsageMonitor() +#if DEBUG + private let thresholdBytes: UInt64 = 4 * 1_024 * 1_024 * 1_024 +#else private let thresholdBytes: UInt64 = 1_024 * 1_024 * 1_024 +#endif private let pollInterval: TimeInterval = 8 // Clamp within 5-10 seconds to limit battery impact private let restartCooldown: TimeInterval = 300 private let logSampleInterval: TimeInterval = 300