PressureBar is a lightweight macOS menu bar utility that shows:
- Current CPU usage
- Current memory usage
- Available memory
- Swap usage
- A simplified memory pressure state
The app is designed to stay small and avoid shelling out to tools like top or vm_stat on every refresh.
- Native macOS menu bar app
- No Dock icon
- CPU and memory updates every 1, 2, or 3 seconds
- Default refresh interval set to 3 seconds to minimize runtime overhead
- Optional launch-at-login toggle
- Compact menu bar label like
C16% M84% - Detail panel with system stats
- Pressure states:
Low,Medium,High
pressurebar/SwiftUI app sourcepressurebar.xcodeproj/Xcode project
- macOS 14.6 or newer
- Xcode 26 or newer
PressureBar currently targets:
- macOS 14.6+
This keeps the app compatible with modern macOS versions while still avoiding an unnecessarily high minimum deployment target.
- Open
pressurebar.xcodeprojin Xcode. - Select the
pressurebarscheme. - Choose
My Macas the run destination. - Press Run.
Because PressureBar is configured as a menu bar utility, it does not open a normal window and does not appear in the Dock. After launch, look for the app in the macOS menu bar.
If Xcode asks for signing:
- Open the
pressurebartarget. - Go to
Signing & Capabilities. - Choose your Apple team for local development.
- Run again.
For a local unsigned build:
xcodebuild \
-project pressurebar.xcodeproj \
-scheme pressurebar \
-configuration Debug \
-derivedDataPath /tmp/pressurebar-derived \
CODE_SIGNING_ALLOWED=NO \
CODE_SIGNING_REQUIRED=NO \
buildThis is useful for validation, but for normal day-to-day use the easiest path is still running from Xcode with local signing enabled.
- Open the PressureBar menu from the menu bar.
- Click
Quit PressureBar.
If the process stays running during development, you can also stop it from Terminal:
pkill -x pressurebarFor public distribution, the recommended path is:
- Sign the app with
Developer ID Application - Keep
Hardened Runtimeenabled - Notarize the final artifact with Apple
- Publish a notarized
.zipor.dmgin GitHub Releases
For a first release, a notarized .zip is the simplest option. A .dmg gives a nicer installation experience and is a good next step.
PressureBar is available on the Mac App Store:
PressureBar uses native macOS APIs from Mach and sysctl, not external command-line tools.
CPU usage is calculated from host_processor_info using PROCESSOR_CPU_LOAD_INFO.
The app stores the previous CPU sample and compares it with the current sample:
totalDelta = currentTotalTicks - previousTotalTicksidleDelta = currentIdleTicks - previousIdleTicksbusyDelta = totalDelta - idleDeltacpuUsage = busyDelta / totalDelta
This produces a system-wide CPU usage percentage over the refresh interval.
Memory values come from host_statistics64 with HOST_VM_INFO64.
PressureBar currently uses:
freeBytes = free_count * pageSizecachedBytes = external_page_count * pageSizeavailableBytes = freeBytes + cachedBytesusedBytes = totalPhysicalMemory - availableBytes
This choice is intentional:
freememory reflects immediately unused pagesexternal_page_countmaps more closely to reclaimable cached memory- using
free + cachedmakes the result align more closely with Activity Monitor than usinginactive_count
Swap is read from:
sysctlbyname("vm.swapusage", ...)
The displayed value is xsu_used.
PressureBar exposes a simplified pressure signal with three states.
Shown when the system still has comfortable headroom.
Current rule:
headroom >= 18%- or swap exists but there is still enough free/cached memory
Shown when available memory is getting tighter, but the system is not yet in the most constrained state.
Current rule:
headroom < 18%- or
swap > 0andheadroom < 28%
Shown when headroom is critically low, or when low headroom and heavy swap usage happen together.
Current rule:
headroom < 6%- or
headroom < 10%andswapRatio > 0.5
Where:
headroom = availableBytes / totalBytesswapRatio = swapUsedBytes / totalBytes
PressureBar is intentionally pragmatic rather than a perfect clone of Activity Monitor.
What it tries to do well:
- stay lightweight
- use native system APIs
- provide values that track Activity Monitor closely enough to be useful in real time
What it does not try to do yet:
- reproduce Apple's exact internal memory pressure model
- expose every VM category shown by Activity Monitor
- Launch at login
- Configurable menu bar text format
- More detailed memory breakdown
- Better historical trend display
- Fine-tuned pressure heuristics based on more real-world comparisons