Find the Most Resource-Intensive Processes on Linux
When a Linux system feels slow, a small number of processes may be consuming most of the CPU, memory, or disk I/O. Several standard tools help identify them quickly.
Highest CPU Usage with ps
ps aux --sort=-%cpu | headFor more rows:
ps aux --sort=-%cpu | head -n 20Highest Memory Usage
ps aux --sort=-%mem | headThis is a snapshot. For changing workloads, use a live monitor.
Interactive Monitoring with top
topPress P to sort by CPU and M to sort by memory in common implementations.
Use htop for an Interactive View
sudo apt install htop # Debian/Ubuntu
sudo dnf install htop # Fedora/RHEL-family systems where available
htophtop provides interactive sorting, filtering, tree views, and signaling.
Monitor Disk I/O with iotop
sudo iotopInstall it from your distribution’s package repository if necessary. I/O-heavy processes can make a system feel slow even when CPU usage is modest.
Per-Process Statistics with pidstat
pidstat is part of the sysstat package on many distributions:
pidstat -u 1 # CPU every second
pidstat -r 1 # memory statistics
pidstat -d 1 # disk I/O statisticsRepeated samples are often more useful than a single snapshot for intermittent problems.
Interpret the Result Before Killing Anything
High resource use is not automatically a bug. A compiler, database query, backup, or batch job may legitimately use available resources. Check what the process is doing, whether the load is expected, and whether service-level symptoms actually correlate with it.
Conclusion
Use ps for quick ranked snapshots, top or htop for live monitoring, iotop for disk activity, and pidstat for repeated per-process measurements. Combine the tools rather than assuming CPU percentage alone explains every performance issue.