English | 中文
A tiny, always-on-top desktop panel that shows macOS memory pressure — and, optionally, CPU load — at a glance. It mirrors the Memory / CPU panels of Activity Monitor so you can keep an eye on the machine without opening Activity Monitor. Single-file Swift, zero third-party dependencies, built with swiftc. The UI is bilingual — switch 简体中文 / English from the menu bar (default 简体中文).

Standard mode — memory + CPU panels
Everything comes from public, unprivileged system interfaces — no special permissions:
- Memory —
host_statistics64(HOST_VM_INFO64)for VM page counts (wired / compressor / free / internal / external / purgeable),sysctl hw.memsizefor the total,sysctl vm.swapusagefor swap. The columns:物理内存 / 已使用内存 / 已缓存文件 / 已使用的交换(physical / used / cached files / swap used)App 内存 / 联动内存 / 被压缩(app / wired / compressed)已使用内存isphysical − free − cached(with a fall-back), soused + cached + free ≈ physical.
- Memory graph — the left graph plots either memory usage (App + Wired + Compressed ÷ physical) or, with the footer 对齐系统 / Match System checkbox, an Activity-Monitor-style pressure approximation (Wired + Compressed share — low when healthy). Either way it is colored per time-segment by the real kernel pressure level (
sysctl kern.memorystatus_vm_pressure_level→ green / yellow / red), so a historical yellow stretch stays yellow after pressure returns to normal. - CPU panel (optional) —
host_statistics(HOST_CPU_LOAD_INFO)ticks → system / user / idle percentages and a stacked load graph;proc_listpidsfor the process count andgetloadavgfor the 1-minute load average. - This app's own CPU — shown in the footer, measured with
getrusage(RUSAGE_SELF)over wall-clock, so you can see the monitor's own footprint. - Minimal mode — collapses to one progress bar for memory (and, if the CPU panel is enabled, one for CPU usage).
Settings (language, refresh interval, CPU panel, minimal mode, graph mode, always-on-top) persist in UserDefaults.
- Apple Silicon (arm64), macOS 13 or later.
Requires the Xcode Command Line Tools (xcode-select --install) — no Xcode project, no Swift Package Manager, no third-party dependencies.
./build.sh # produces ./MacMemMonitor.appThe core compile command is the same in build.sh and CI:
swiftc -O -swift-version 5 -target arm64-apple-macos13.0 -o MacMemMonitor.app/Contents/MacOS/MacMemMonitor main.swiftbuild.sh also generates the icon (./makeicon.sh), writes Info.plist, and ad-hoc signs the bundle.
open ./MacMemMonitor.appControls live in the bottom strip: refresh interval (0.5 / 1 / 2 / 5 s), 对齐系统 / Match System (graph height = system pressure instead of usage), CPU panel toggle, 最小 / Compact mode, 置顶 / On Top (always-on-top). Language is switched from the menu bar. No permission prompts.
First launch may be blocked by Gatekeeper (the app is ad-hoc signed, not notarized) — right-click the app and choose Open, or clear the quarantine flag: xattr -dr com.apple.quarantine MacMemMonitor.app.
| Limit | Detail |
|---|---|
| Architecture | Apple Silicon (arm64) binary; rebuild on Intel if needed |
| Signing | ad-hoc (codesign -s -); recipients right-click → Open, or xattr -dr com.apple.quarantine |
| Notarization | none — not distributed via App Store |
| macOS | 13 or later |
- The "Match System" pressure height is an approximation. The real kernel algorithm is private; when Match System is on, the plotted height is the
Wired + Compressedshare (low when healthy, rising as the compressor works) — an approximation of Activity Monitor's pressure, not an exact value. The default graph instead plots real memory usage. The per-segment color is always the real kernel pressure level. - No total thread count. An accurate system-wide thread count needs elevated privileges, so it is deliberately not shown; the CPU panel shows the process count and the load average instead.
- The CPU panel is system-wide (
host_statistics), not this app. This app's own usage is computed separately withgetrusageand shown in the footer. - The user percentage folds in
nicetime. Self-CPU% can exceed 100% on multi-core work (it is only lower-bounded at 0). - The process count is sampled between two
proc_listpidscalls, so it is approximate. - The UI is bilingual (简体中文 / English, switchable from the menu bar, default 简体中文); the README is bilingual too.
MIT © 2026 ExWang

