Marcio Cunha

How to use htop to find heavy processes on Linux

Learn how to read CPU, virtual memory, and I/O metrics in htop to identify operational bottlenecks and safely terminate frozen processes on production servers.

Marcio Cunha•4 min
Also available in:PortuguêsEspañol
Summary
  • Htop replaces the traditional top command by displaying real-time colored bars for core utilization, memory, and swap space.
  • The VIRT column shows how much memory a program requested, while the RES column reveals actual physical RAM consumption.
  • Excessive disk I/O can freeze a server even when the CPU is idle, requiring close attention to IO_READ and IO_WRITE columns.
  • Pressing the F9 key lets administrators send operational signals like SIGTERM to cleanly shut down frozen tasks.
  • Continuous monitoring prevents catastrophic production outages by diagnosing sudden load spikes before they escalate.

What is htop and why is it essential for daily operations

When a server starts responding slowly or freezes unexpectedly, the first reflex of any system administrator is to open a terminal to figure out what is going on. That is when htop becomes the most vital tool in the toolkit. In practice, it acts as an interactive control panel showing everything the computer is executing second by second, making it much easier to spot software consuming excessive resources improperly.

Unlike the classic top command, which has been around for decades and provides a very simple interface built on plain text, htop delivers colorful graphs, smooth navigation using the mouse or keyboard arrows, and quick shortcuts at the bottom of the screen. To better understand how systems behave under intense pressure, it is helpful to cross-reference these checks with advanced techniques, as explained in our guide on how to find zombie processes on Linux and free up CPU, ensuring hidden ghost tasks do not quietly consume processing cycles.

Reading CPU and memory usage bars at the top of the screen

As soon as you type htop in the terminal, the top section of the screen displays several horizontal bars accompanied by numbers. These bars represent the current utilization of each processor core, alongside RAM memory and swap space, which acts as a disk-based overflow area when physical memory runs out.

The colors inside the processing bars help differentiate the type of effort the machine is under. Dark blue shows low-priority processes, green indicates tasks executed by standard users, and red points out the time consumed by the operating system kernel itself. If the red bar is exceptionally high, it means the server is spending more energy managing itself than running actual user applications.

Understanding the difference between virtual and resident memory

Looking further down into the process table reveals key columns, most notably VIRT and RES. The VIRT column, which stands for virtual memory, shows the total address space requested by the program, even if most of it is merely reserved and not actively used. Meanwhile, the RES column, known as resident memory, indicates the exact amount of physical RAM the application is consuming at that exact moment.

Many people get startled when they see gigantic numbers in the virtual memory column and assume the server will run out of capacity immediately. In practice, the operating system is smart and allocates generous amounts of address space for safety. The metric that truly matters when investigating resource leaks is the RES column, as it dictates when the machine will start running out of available physical memory.

Spotting I/O bottlenecks and slow disk operations

Another classic issue that brings down servers is storage latency caused by excessive reading and writing. When a hard drive or solid-state drive gets overwhelmed, task queues back up and the entire system appears to freeze, even if the CPU is completely idle. To diagnose this inside htop, you can enable additional columns that display real-time read and write throughput rates.

If you notice that storage bottlenecks are choking overall performance, it is worth deepening the investigation with specialized block subsystem analysis tools, a topic we cover thoroughly in our article on how to spot I/O and IOPS bottlenecks on Linux. Identifying whether the bottleneck originates from a misconfigured database or excessive log generation prevents unnecessary hardware replacements.

How to safely kill frozen processes using htop

Finding the application responsible for the slowdown is only half the battle; the next step is interrupting that process without bringing down the entire server. In htop, simply navigate with the arrow keys to the troublesome program line and press the F9 key, which opens a side menu featuring various operational signals.

The default signal offered is SIGTERM (number 15), which acts as a polite request asking the program to save its data and shut down gracefully. If the software is completely frozen and unresponsive, the alternative is selecting SIGKILL (number 9), which forces the operating system to terminate the task immediately, freeing up resources instantly. To explore these architectural concepts further in production, see our related technical analysis on How to test Schottky diodes on a circuit board with a multimeter.

Final considerations on proactive server monitoring

Maintaining stability in a production environment requires daily discipline and familiarity with terminal-based observability tools. htop remains an indispensable ally by combining visual simplicity and technical depth into a single accessible interface. By combining this inspection routine with solid infrastructure sizing practices, administrators can anticipate failures, protect data, and ensure applications run at peak efficiency without unpleasant surprises.