ProjectsCase study
OpenMem — Free memory and disk cleaner for macOS
OpenMem is a free, open-source macOS menu bar app that shows live memory use and frees memory and disk space. Every feature is included: there is no Pro version, no trial, no account and no telemetry, and the app never connects to the internet.
- Swift 6
- SwiftUI
- macOS 14+
- Darwin APIs
- Shell
Memory
- Live memory use in the menu bar, as a percentage or in GB. The number turns orange 10 points below your threshold and red when it reaches it.
- Free up memory with one click or with Control-Option-Command-M from any app: it runs sync, then memory_pressure, then purge, and reports how much it freed.
- The five apps using the most memory, with helper processes counted under the app that owns them. Hover over an app to quit it.
- Automatic cleanup when memory use passes a threshold you choose, from 50 to 95%. It keeps the disk cache, so the Mac doesn't stall.
Disk
- Junk files, developer files (node_modules, build output, Xcode, Android and package-manager caches), installers, and large or old files.
- A duplicate finder that matches files byte for byte: by size, then the first 64 KB, then a full SHA-256.
- An app uninstaller that also removes the app's support files, plus leftovers of removed apps and the items that start with your Mac.
- A disk space map of any folder or drive, shown five ways: treemap, sunburst, icicle, bubbles and a list, with search by name, size and kind.
Your files stay safe
- Everything goes to the Trash; the app never deletes a file outright. The only permanent action is Empty Trash, and it asks first.
- It works only inside a fixed list of folders and checks each path again right before moving it. Apple apps and the caches of running apps are never touched.
- Bulk cleaning is limited: downloads, duplicates, installers and large files are ticked one by one. ./test.sh checks these rules.
How it works
- Memory % uses host_statistics64 with the same formula as Activity Monitor; per-app memory uses proc_pid_rusage, without starting ps or top.
- The menu bar makes one system call every 3 seconds; per-app memory is only measured while the panel is open.
- Measured idle: a 1.6 MB app, 15 MB of memory before the first disk scan, 0.1 to 0.3% CPU, no network connections. ./perf.sh fails the build if the idle budget is exceeded.
Stack
- Swift 6 and SwiftUI, about 1,900 lines in six files
- Built with swiftc by build.sh: no Xcode project, no bundled frameworks, nothing downloaded
- GPL-3.0