Which htop Column Shows Process Memory Percentage?
This article provides a quick overview of how to monitor memory usage
in Linux using the htop command-line tool, specifically
identifying the column that displays the percentage of memory consumed
by an individual process. You will learn the exact name of this column,
how it calculates memory utilization, and how to effectively navigate
htop to sort and manage resource-heavy processes on your
system.
The Short Answer: %MEM
In the htop interactive process viewer, the column that
shows the percentage of memory used by a single process is
%MEM. This column calculates the process’s resident set
size (the actual physical memory the process is using) as a percentage
of the total available physical RAM on the system.
Understanding Memory Columns in htop
While %MEM gives you the quick percentage breakdown,
htop includes several other critical memory-related columns
that help you understand exactly how a process is utilizing system
resources. By default, you will see the following columns alongside
%MEM:
- VIRT (Virtual Image): The total amount of virtual memory allocated to the process. This includes all code, data, shared libraries, and pages that have been swapped out or mapped but not yet used.
- RES (Resident Set Size): The actual, non-swapped
physical memory (RAM) the process is currently using. This is the value
used to calculate the
%MEMpercentage. - SHR (Shared Memory): The amount of shared memory used by the process, which could potentially be shared with other processes.
How to Sort Processes by Memory Usage
If you are troubleshooting a slow system and want to find out which
process is hogging your RAM, you can easily sort the process list by the
%MEM column using these steps:
- Launch
htopby typinghtopin your terminal. - Press F6 (or Shift + O on some configurations) to open the “Sort by” menu on the left side of the screen.
- Use the arrow keys to scroll down and select
PERCENT_MEM (or
%MEM). - Press Enter. The process consuming the most memory will now appear at the very top of the list.
Alternatively, you can simply click on the %MEM column header with your mouse if your terminal emulator supports mouse tracking.