Skip to content

MemPressure v1.4.1

Choose a tag to compare

@benfiart benfiart released this 18 May 06:58
· 1 commit to main since this release

Fix memory leak from popover view tree

The popover's SwiftUI view tree (PopoverView) was created at app launch and held for the process lifetime, even when hidden. Its 5 @ObservedObject subscriptions stayed active on every 2-second monitor tick, causing ~44 MB residency after the first popover open plus ~1.6 MB/hour drift.

After this fix the view tree is created lazily when the popover opens and released when it closes. 24-hour validation: memory drift dropped from 1.6 MB/h to 0.04 MB/h (40× reduction), with no post-wake spikes across 8 sleep cycles.

This is what was causing macOS to occasionally flag MemPressure as a high-energy app — the leak gradually inflated its rolling Energy Impact score until it crossed Apple's threshold.

No visible behavior changes; the cog animation and all other UI is exactly as before.