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—that let you view and analyze RAM consumption in real time, with usage examples and screenshots.

Open Source Linux
Open Source Linux
Open Source Linux
12 Essential Linux Commands to Monitor Memory Usage

When optimizing a Linux system, physical memory is a critical resource, and Linux provides many ways to monitor its usage. The following list details various tools and command‑line methods for checking memory consumption on Linux.

/proc/meminfo

The simplest way to view RAM usage is the virtual file /proc/meminfo, which aggregates data shown by tools such as free, ps, and top. It lists all memory statistics, and per‑process memory can also be examined via /proc/<pid>/statm and /proc/<pid>/status.

cat /proc/meminfo

atop

The atop command is a terminal‑based monitor that shows CPU, memory, network, I/O, and kernel activity, with color‑coded highlights for high‑load situations.

sudo atop

free

The free command provides a quick overview of memory usage by summarizing information gathered from /proc/meminfo.

free -h

GNOME System Monitor

GNOME System Monitor is a graphical tool that displays recent CPU, memory, swap, and network usage, offering another way to view memory consumption.

gnome-system-monitor

htop

htop

shows real‑time memory usage for each process, reporting resident set size, total program memory, shared library size, and allows horizontal and vertical scrolling.

htop

KDE System Monitor

The KDE counterpart provides the same functionality as the GNOME version.

ksysguard

memstat

memstat

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

memstat -p <PID>

nmon

nmon

is an ncurses‑based benchmark tool that monitors CPU, memory, I/O, filesystem, and network resources. For memory, it shows total/available memory and swap in real time.

nmon

ps

The ps command displays memory usage per process, including %MEM, VSZ, and RSS. It supports sorting, e.g., by RSS.

ps aux --sort -rss

smem

smem

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

sudo smem --piename -c "pss"

top

top

provides a real‑time view of running processes and their resource consumption, allowing sorting by memory usage.

top

vmstat

vmstat

shows both real‑time and average statistics for CPU, memory, I/O, etc. For memory, it reports physical and virtual memory details.

vmstat -s
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.

LinuxSystem AdministrationMemory Monitoringprocfs
Open Source Linux
Written by

Open Source Linux

Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.

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.