Commands.page Logo

VIRT vs RES Memory in Htop Explained for Ubuntu Users

When managing processes on Ubuntu, the htop utility displays memory usage through various columns, specifically VIRT and RES. Many users struggle to distinguish between these values, leading to confusion about actual RAM consumption. This guide clarifies the technical differences between virtual and resident memory, enabling you to monitor system health effectively and troubleshoot high memory usage accurately.

What Is VIRT Memory?

VIRT stands for Virtual Memory. This value represents the total amount of virtual memory used by a process. It includes every piece of memory the process can access, including:

Because VIRT accounts for reserved address space rather than physical hardware usage, the number is often significantly larger than the actual RAM being consumed. A process can reserve gigabytes of virtual address space while only using a fraction of it physically.

What Is RES Memory?

RES stands for Resident Memory. This column indicates the non-swapped physical memory that a task is currently using. It represents the portion of the process that is actually held in the system’s RAM at that moment.

RES is the most accurate metric for determining how much hardware memory a process is consuming. If your Ubuntu system is running slow due to memory pressure, the RES column is the primary indicator you should investigate.

Why the Difference Matters

Understanding the distinction prevents misdiagnosis of system performance issues. A common scenario involves a process showing a VIRT value of several gigabytes while the RES value remains only a few megabytes. This happens when a program allocates memory for potential future use but does not write data to it immediately.

When analyzing system performance on Ubuntu, focus on the RES column to identify processes causing genuine memory load. Relying on VIRT can lead to false alarms regarding resource exhaustion, while RES reveals the true impact on your physical hardware.