macOS developers and power users have long relied on Activity Monitor for system monitoring, but its GUI interface does not fit well into terminal-centric workflows. Mactop (metaspartan/mactop on GitHub) fills this gap with a beautiful, terminal-based system monitor that provides real-time visibility into CPU, memory, GPU, network, and disk performance, all within the terminal.
Created by metaspartan, Mactop is built specifically for macOS using native system APIs, giving it access to metrics that cross-platform tools cannot read. It displays real-time CPU usage per core with history graphs, memory breakdown showing active, wired, compressed, and free memory, GPU utilization for both Apple Silicon and AMD GPUs, network throughput with per-interface statistics, disk I/O performance, and a sortable process list.
The application is written with a focus on both functionality and aesthetics. The terminal user interface (TUI) uses carefully designed layouts, color schemes, and unicode characters to present information clearly without overwhelming the user. Multiple views can be toggled between, allowing users to focus on the metrics most relevant to their current task.
Monitoring Architecture
Mactop collects system metrics through multiple macOS APIs and presents them through a unified terminal interface:
graph TD
A[Mactop TUI\nTerminal Interface] --> B[Data Collection Engine\nRefresh Loop]
B --> C[CPU Metrics\nhost_cpu_load_info / mach_host]
B --> D[Memory Metrics\nhost_statistics64 / task_info]
B --> E[GPU Metrics\nIOKit / Metal Performance Shaders]
B --> F[Network Metrics\nifaddrs / netstat]
B --> G[Disk Metrics\nfsctl / IOKit]
B --> H[Process Metrics\nproc_listallpids / sysctl]
C --> I[Display Widgets\nCPU / Memory / GPU / Network / Disk]
D --> I
E --> I
F --> I
G --> I
H --> I
I --> J[User Interaction\nKeyboard Controls]The data collection runs on a configurable refresh cycle, minimizing performance impact while keeping the display up to date.
Metrics Display
| Metric Category | Data Points | Apple Silicon Support | Refresh Rate |
|---|---|---|---|
| CPU | Per-core usage, load average, temperature | Yes | 1 second |
| Memory | Active, wired, compressed, cached, swap | Yes (unified) | 1 second |
| GPU | Utilization, memory used, temperature | Yes (M-series) | 2 seconds |
| Network | In/out speed, total data, per interface | Yes | 2 seconds |
| Disk | Read/write speed, I/O operations, usage | Yes | 2 seconds |
| Processes | CPU%, memory%, PID, user, command | Yes | 3 seconds |
Practical Usage Scenarios
Mactop is useful in several common scenarios. Developers debugging performance issues can keep Mactop running in a split terminal pane, watching how their application affects system resources in real time. Build engineers monitoring CI jobs can track CPU and memory usage to identify resource bottlenecks. Power users monitoring background processes can quickly identify misbehaving applications consuming excessive resources.
For Apple Silicon users, Mactop’s GPU monitoring is particularly valuable. GPU utilization is a blind spot in most system monitoring tools, yet it is critical for media production, machine learning, and gaming workloads. Mactop reads GPU metrics through IOKit and Metal Performance Shaders APIs, providing visibility into an increasingly important system resource that Activity Monitor itself does not fully expose.
The process view provides detailed information about running processes, including per-process CPU and memory usage, thread count, file descriptors, and I/O activity. Processes can be sorted by any column, making it easy to identify resource hogs.
Recommended External Resources
- Mactop GitHub Repository – Source code, releases, and documentation
- macOS System Performance APIs – Apple’s kernel API documentation for system monitoring
FAQ
What is Mactop? Mactop is an open-source, terminal-based system monitor for macOS developed by metaspartan. It displays real-time metrics for CPU, memory, GPU, network, disk, and processes in a clean, customizable TUI (terminal user interface). It is designed as a modern alternative to the built-in Activity Monitor and htop for macOS users who prefer terminal-based workflows.
What metrics does Mactop display? Mactop displays real-time CPU usage per core with history graphs, memory usage breakdown (active, wired, compressed, free), GPU utilization and memory for Apple Silicon and AMD GPUs, network throughput with per-interface breakdown, disk I/O with read/write speeds, process list with resource consumption, and system uptime and load averages.
Does Mactop support Apple Silicon’s unified memory architecture? Yes, Mactop has specific support for Apple Silicon Macs, displaying unified memory usage across CPU and GPU, GPU utilization metrics from the M-series GPU, and power consumption data when available. It detects the hardware platform and adjusts its data sources accordingly.
Can Mactop be customized? Yes, Mactop supports configuration through a YAML configuration file and command-line flags. Users can customize which metrics are displayed, the refresh rate, color scheme, process sorting, and display layout. Configuration profiles can be saved and switched between for different monitoring scenarios.
How does Mactop compare to htop or btop? Mactop provides macOS-specific metrics that general tools like htop and btop miss, particularly GPU utilization, Apple Silicon-specific memory metrics, and power consumption data. It also has a cleaner, more modern interface designed specifically for macOS. However, it only runs on macOS, unlike the cross-platform htop and btop.
Further Reading
- Mactop on GitHub – Source code, binary releases, and configuration guide
- Apple Kernel API Documentation – System performance API reference for macOS
無程式碼也能輕鬆打造專業LINE官方帳號!一鍵導入模板,讓AI助你行銷加分!