A lightweight macOS menu-bar utility that watches running processes and reclaims memory before your Mac starts swapping. MemoryShield samples per-process RSS, plots history, and can automatically terminate user apps that stay above a configurable threshold for a sustained duration.
- Live per-process memory usage with icons, uptime, and percentage of total RAM
- Configurable memory threshold (MB) and sustain duration (seconds) before action
- Optional auto-kill of user apps that exceed the threshold
- Rolling history chart per process
- Activity log of terminations
- Native SwiftUI app, no background daemons, no telemetry
- macOS 14 or later
- Xcode 15+ (for building from source)
make build # unsigned Release build into ./build
make run # build and launch
make install # copy MemoryShield.app to /Applicationsbundle install
make fastlane-run
make fastlane-install- Launch MemoryShield.
- Set the Threshold (MB) above which a process is considered a memory hog.
- Set the Sustain (s) window — how long a process must stay above the threshold before it is eligible to be killed.
- Toggle Auto-kill to let MemoryShield terminate offenders automatically, or leave it off to just monitor.
System processes are filtered out — only user apps are eligible for termination.
MemoryShield/
├── MemoryShield/ # SwiftUI sources
│ ├── MemoryShieldApp.swift
│ ├── ContentView.swift
│ └── ProcessMonitor.swift
├── MemoryShield.xcodeproj/
├── fastlane/
├── Makefile
└── Gemfile
Issues and PRs are welcome. Please read SECURITY.md before reporting anything that looks like a vulnerability.
MIT © Matheus Gois