To monitor system CPU and memory usage, there are several tools and methods available depending on your operating system. Here’s how to do it across common platforms:
Windows
1. Task Manager
-
Press
Ctrl + Shift + Escor right-click the taskbar and choose Task Manager. -
Under the Performance tab, you can view:
-
CPU Usage: Current load, speed, number of cores.
-
Memory Usage: Total, available, in use.
-
2. Resource Monitor
-
Open Run (
Win + R), typeresmonand press Enter. -
Go to the CPU and Memory tabs for detailed insights.
3. Command Line
macOS
1. Activity Monitor
-
Found in
/Applications/Utilities/Activity Monitor. -
Displays real-time CPU and memory usage per process and system-wide.
2. Terminal
You can also use htop if installed via Homebrew:
Linux (Ubuntu, CentOS, etc.)
1. top / htop
Or with htop (requires installation):
2. vmstat
3. free –m
Shows memory in MB:
4. mpstat (from sysstat)
5. ps command
To check top CPU or memory consuming processes:
Cross-Platform Python Script
If you want to build a custom monitor:
Install psutil with:
System Monitoring Tools
-
Grafana + Prometheus: Advanced, real-time dashboards.
-
Nagios: Enterprise-grade monitoring.
-
Glances (Cross-platform):
Use these tools depending on your needs—quick checks via top, detailed GUI with Task/Activity Monitor, or persistent tracking with Grafana or custom scripts.