Operations 6 min read

12 Essential Linux Commands to Monitor Memory Usage

This guide lists twelve Linux tools and commands—including /proc/meminfo, atop, free, GNOME System Monitor, htop, KDE System Monitor, memstat, nmon, ps, smem, top, and vmstat—detailing how each provides real‑time or summarized insights into RAM consumption and overall system performance.

ITPUB
ITPUB
ITPUB
12 Essential Linux Commands to Monitor Memory Usage

When optimizing a Linux system, monitoring physical memory is crucial, and Linux offers many utilities to observe memory usage. The following list describes twelve methods, ranging from simple file reads to graphical monitors, each with example commands.

/proc/meminfo

The virtual file /proc/meminfo provides a dynamic snapshot of memory statistics, serving as the data source for tools like free, ps, and top. Process‑specific memory can also be examined via /proc/<pid>/statm and /proc/<pid>/status.

cat /proc/meminfo
Linux memory monitoring methods
Linux memory monitoring methods

atop

The atop command runs in a terminal and displays a colored, comprehensive view of CPU, memory, network, I/O, and kernel activity, especially useful under high load.

sudo atop
atop output
atop output

free

free

offers a quick overview of memory usage by summarizing the information gathered from /proc/meminfo.

free -h
free command output
free command output

GNOME System Monitor

A graphical tool that shows recent CPU, memory, swap, and network usage, allowing users to inspect processes and resource consumption.

gnome-system-monitor
GNOME System Monitor
GNOME System Monitor

htop

htop

provides a real‑time, interactive view of each process's memory usage, including resident set size, shared libraries, and total memory per process, with scrollable lists.

htop
htop interface
htop interface

KDE System Monitor

Provides functionality similar to the GNOME monitor, invoked with ksysguard.

ksysguard
KDE System Monitor
KDE System Monitor

memstat

memstat

identifies virtual memory usage of executables, processes, and shared libraries. With a PID, it lists associated files, data, and libraries.

memstat -p
memstat output
memstat output

nmon

An ncurses‑based benchmark tool that monitors CPU, memory, I/O, filesystem, and network. For memory, it shows total and free memory and swap usage in real time.

nmon
nmon memory view
nmon memory view

ps

The ps command can display each process's memory usage, including %MEM, VSZ, and RSS. Sorting by RSS is possible with the --sort -rss option.

ps aux --sort -rss
ps memory sorting
ps memory sorting

smem

smem

aggregates memory usage per process and per user based on /proc data, and can export charts such as bar or pie graphs.

sudo smem --pie name -c "pss"

top

top

provides a live view of running programs and their resource consumption, allowing sorting by memory usage.

top
top command
top command

vmstat

vmstat

reports both real‑time and averaged statistics for CPU, memory, and I/O. It shows physical and virtual memory usage.

vmstat
vmstat output
vmstat output

This collection equips Linux administrators with a comprehensive toolbox for tracking memory consumption, from low‑level file reads to full‑featured graphical monitors.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

performanceLinuxSystem AdministrationMemory Monitoringcommands
ITPUB
Written by

ITPUB

Official ITPUB account sharing technical insights, community news, and exciting events.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.