Mac maintenance
top vs htop on Mac (Plus Better Alternatives)
Compare top and htop on macOS for live process monitoring — plus btop, glances, and the modern tools that surpass them on Apple Silicon.
You SSH’d into your Mac, or you’re in the Terminal because Activity Monitor is too slow to load, and you want to see what’s eating CPU. The classic answer is top. The classic-but-prettier answer is htop. The modern answer is “neither, use btop.” Here’s what each one actually shows you, where they differ on macOS specifically, and which one to reach for.
top — the one that’s already installed
top
Output looks something like:
Processes: 537 total, 3 running, 534 sleeping, 2918 threads
2026/04/22 14:32:18
Load Avg: 1.52, 1.48, 1.38 CPU usage: 4.2% user, 2.1% sys, 93.5% idle
SharedLibs: 312M resident, 67M data, 31M linkedit.
MemRegions: 134567 total, 4521M resident, 312M private, 1234M shared.
PhysMem: 23G used (3567M wired), 5234M unused.
VM: 156T vsize, 4567M framework vsize, 0(0) swapins, 0(0) swapouts.
Networks: packets: 12345/15M in, 9876/8M out.
Disks: 234567/12G read, 156789/8G written.
PID COMMAND %CPU TIME #TH #WQ #PORTS MEM PURG CMPRS PGRP
99876 Xcode 145.2 1:23:45 56 2 1234 4567M 234M 876M 99876
12345 Google Chrome 23.4 4:32:11 78 3 2345 1234M 567M 234M 12345
...
Two halves: a system summary at the top, a process list below. By default, sorted by PID, refreshing every second.
The keys you’ll actually use:
o— change sort order. Typecpu,mem,time, etc.Space— refresh now.?— help.q— quit.
To start sorted by CPU:
top -o cpu
By memory:
top -o mem
For a one-shot snapshot (useful in scripts):
top -l 1 -o cpu -n 10
-l 1 runs one iteration and exits. -n 10 limits to 10 processes.
The output of top on macOS is meaningfully different from Linux’s top because Apple wrote their own. Some columns (#WQ, #PORTS, MEM, PURG, CMPRS) don’t exist on Linux. RPRVT and RSHRD were old fields that have been removed. The naming and behavior have evolved across macOS versions.
What the columns mean
A quick reference for the macOS-specific ones:
%CPU— CPU percentage. Can exceed 100% on multi-core systems (160% means using 1.6 cores).TIME— total CPU time consumed since the process started.#TH— number of threads.#WQ— number of dispatch queues (workqueues).#PORTS— Mach ports the process holds.MEM— resident memory size.PURG— purgeable memory (memory the OS could reclaim).CMPRS— compressed memory size.PGRP— process group ID.
The MEM column is what people usually want when asking “how much RAM is this app using?” It’s the resident size — the actual physical memory holding this process’s pages.
htop — the friendlier interface
brew install htop
htop
htop doesn’t ship with macOS. Install via Homebrew. The interface gives you per-CPU usage bars, a memory bar, and a tree view of processes:
- F2 / Setup — configure columns and behavior.
- F3 / Search — find a process by name.
- F4 / Filter — filter the list to matching names.
- F5 / Tree — toggle tree view (parent/child relationships).
- F6 / SortBy — change sort column.
- F7 / Nice -— nice the selected process.
- F9 / Kill — send a signal.
- F10 / Quit.
Two things htop does much better than top:
- Tree view. Showing the parent-child hierarchy makes it obvious which “Helper” processes belong to which app. Chrome alone runs 30+ processes; tree view groups them.
- Filtering. Type a partial name and only matching processes show. Way faster than scrolling.
What htop shows that top doesn’t:
- Per-CPU bars at the top (one per core).
- A nicer memory bar with color-coded sections.
- The “swap” bar (less relevant on macOS).
What top shows that htop doesn’t (or shows poorly):
- macOS-specific memory metrics like compressed and purgeable.
- Mach port counts.
- Process I/O counters.
The general rule: htop is better for “I want to see what’s happening” interactive use. top is better for “I need accurate macOS-specific numbers.”
htop shows zero CPU usage for processes you can clearly see are working, you may need to run it with sudo htop. macOS restricts process info access more aggressively than Linux.btop — the prettiest one
brew install btop
btop
btop (a continuation of bpytop/bashtop) is a richer TUI process monitor. It draws CPU, memory, network, and disk graphs as vertically-scrolling charts, alongside the process list.
Why use it over htop:
- Live graphs. Trend matters more than instant snapshots.
- Network and disk I/O are first-class.
- Customizable layouts.
- The colors are nice.
Why NOT use it:
- It uses more CPU itself than
htoportop— somewhat ironic. - Charts can lag a little on slower terminals.
- Some people just don’t need the visualization.
For most modern Mac use, btop is what I’d recommend if you only want to learn one. The interface is intuitive, you can mouse-scroll the graphs, and it covers everything.
glances — the Python one
brew install glances
glances
glances is a Python-based system monitor that aggregates more sources than the others — CPU, memory, disk, network, sensors, Docker containers, and more. It’s “everything on one screen.”
Why use it:
- Comprehensive at a glance.
- Has a built-in web UI:
glances -wand connect tohttp://<mac>:61208/. - Exports to InfluxDB, Prometheus, etc., for monitoring fleets.
Why not:
- Heavier than the others.
- Some columns don’t apply on macOS.
For a single-Mac use case, it’s overkill. For “I want one tool for laptops and a server,” it’s good.
What about Activity Monitor?
The GUI is slower to load and to use than any of the above, but it shows things the CLIs don’t:
- Energy Impact (an Apple-specific metric).
- The “Cache” memory category.
- Network activity per app.
- The disk I/O graph.
For one-off “what’s that process?” lookups, GUI is fine. For sustained monitoring, the CLIs are dramatically less heavy on the system itself.
A trick: Activity Monitor refreshes every 5 seconds by default. To make it more responsive: View → Update Frequency → “Very Often” (every second).
Common patterns
“What’s eating CPU right now?”
top -l 1 -o cpu -n 10
One snapshot, top 10 by CPU. No interactive refresh. Pipe through head if you want fewer.
“What’s using the most memory?”
top -l 1 -o mem -n 10
Same, sorted by memory.
“Which process has the most file descriptors?”
lsof | awk '{print $2}' | sort | uniq -c | sort -rn | head
Outputs a count of open files per PID. Useful when you suspect a leaky daemon.
“Watch a specific process over time”
top -pid 12345
Just one process. Updates every second. Useful for “is this app’s memory still growing?”
Differences from Linux for muscle-memory transplants
If you’ve come from Linux, expect:
toplooks different. The sort key iso(notShift+P). The first column is PID (not USER).htopis identical, but you have to install it.iotopdoesn’t exist on macOS (covered in another guide).iostatexists but reports different data.freedoesn’t exist; usevm_statortop’s memory section.
Why your CPU shows asymmetric load on Apple Silicon
Apple Silicon Macs have two types of cores: P-cores (performance) and E-cores (efficiency). On an M3 Pro, that’s 6 P-cores and 6 E-cores (12 total). When you see top showing varying load between cores, that’s not weird — the kernel schedules background tasks to E-cores and foreground to P-cores by design.
htop shows this clearly with per-core bars; some cores will be at 100% while others are at 5%. That’s normal.
To see core types:
sysctl -n machdep.cpu.brand_string
sysctl hw.perflevel0.physicalcpu hw.perflevel1.physicalcpu
Performance level 0 is P-cores, level 1 is E-cores.
Headless via SSH
A common reason to want CLI process monitors on a Mac: SSH’d in from another machine. All four (top, htop, btop, glances) work fine over SSH.
A small caveat: btop and glances need a terminal that supports 256 colors and Unicode. The default Terminal.app is fine. iTerm2 is fine. Some headless environments aren’t — you may need to set TERM=xterm-256color explicitly.
When the process is dead and won’t die
top shows you a process consuming CPU. You try to quit the app. Activity Monitor’s Force Quit doesn’t work. Try:
killall ProcessName
If that fails:
killall -9 ProcessName
If even SIGKILL doesn’t work, the process is in uninterruptible sleep — usually waiting on a stuck I/O. Common causes: a network volume that’s gone away, a USB device that’s malfunctioning. Unplug, force-eject, or reboot.
Comparison summary
| Tool | Installed? | Best for | Watch out for |
|---|---|---|---|
| top | Yes | Quick CLI check, scripts | macOS-specific syntax |
| htop | brew | Interactive sessions, tree view | Some perms need sudo |
| btop | brew | Pretty visualizations | Slightly heavier |
| glances | brew | Multi-source monitoring, web UI | Python overhead |
| Activity Monitor | Yes | Energy impact, GUI fans | Slow to start |
For “I just want to see what’s slow on my Mac right now,” I reach for top -o cpu first because it’s installed everywhere. For deeper investigations, htop or btop.
A useful alias
alias topcpu='top -l 1 -o cpu -n 10'
alias topmem='top -l 1 -o mem -n 10'
Two-second one-shot CPU and memory listings. Drop in ~/.zshrc.
Bottom line
top is the no-installation default. htop is the friendlier traditional pick. btop is the modern visualization-first option. They all answer the same question — “what is this Mac doing right now?” — at different levels of polish. Pick whichever you’ll actually open when something feels slow. The best monitor is the one you reach for.