What Does the htop M_RESIDENT Column Filter Do?

Inside the setup options of the htop Linux command line tool, enabling the M_RESIDENT column filter instructs the program to display only the memory that is currently and actively residing in the system’s physical RAM for each process. This filter provides a more accurate representation of a process’s actual, immediate footprint on your hardware by stripping away virtual memory allocations that haven’t been mapped to physical memory or have been swapped out to disk.

Understanding M_RESIDENT in htop

To understand what the M_RESIDENT filter achieves, it helps to look at how Linux manages memory. A standard process often allocates a large amount of Virtual Memory (VIRT), but it rarely uses all of it at the same time. The Resident Set Size (RES) represents the portion of that memory actually sitting in your RAM chips right now.

When you configure htop to filter or sort by M_RESIDENT, you are shifting the focus away from theoretical memory allocations and focusing strictly on real-time physical resource consumption.

Why Use the M_RESIDENT Filter?

System administrators and developers use this specific filter for several practical troubleshooting scenarios:

How to Enable It in the htop Interface

To add or configure memory columns like M_RESIDENT in htop, you can navigate through the setup menu by following these steps:

  1. Open htop in your terminal.
  2. Press F2 (or S) to enter the Setup menu.
  3. Use the arrow keys to scroll down to Columns in the left-hand menu.
  4. Move to the Available Columns list on the right and look for memory-related metrics.
  5. Select the desired resident memory metric, press F5 to add it to your visible columns, and press F10 to save and exit.