October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk7 min

Why `free -m` and `ps aux` Show Different Memory Usage on Linux

Linux’s free -m and ps aux commands measure different memory scopes. This guide explains RSS, VSZ, PSS, cache, swap and a practical workflow for finding where RAM is going.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Short answer: free -m reports memory for the entire Linux host, while ps aux reports virtual and resident memory for individual processes. They count different things, use different accounting rules, and read live system data at slightly different times, so their totals are not expected to match.

Use free to answer “How much RAM and swap can the machine provide?” Use ps to answer “Which processes have resident pages?” For a fairer per-process total when memory is shared, inspect proportional set size (PSS), not a simple sum of RSS values.

As an Amazon Associate I earn from qualifying purchases.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What free -m actually measures

The free utility summarizes physical RAM and swap for the whole operating system. It reads counters from /proc/meminfo; the -m option changes the displayed unit to megabytes. On current procps versions, the underlying counters are reported in KiB and converted for presentation, so the figures are rounded display values rather than a new measurement.

A typical output has columns for total, used, free, shared, buffers, cache, buff/cache and available memory. The modern procps definition of used is:

used = total - available

That is deliberately different from treating every page that is not currently on the free list as permanently consumed by applications. available estimates how much memory new applications can obtain without forcing the system to swap. It considers free pages plus memory that the kernel can reclaim, such as file-backed cache and reclaimable slab objects.

How to read the important fields

Field Meaning How to use it
total Physical RAM or swap configured for the host, depending on the row. Establishes the capacity being discussed.
used For RAM, procps calculates this as total minus available. Do not interpret it as the sum of application RSS.
free Pages currently unused by the kernel. A low value alone is not evidence of memory pressure.
shared Memory attributed mainly to tmpfs and shared-memory use. Investigate alongside Shmem in /proc/meminfo.
buff/cache Buffers, page cache and reclaimable kernel slab memory. This can grow during normal I/O and can often be reclaimed.
available An estimate of memory that can be given to new programs without swapping. This is usually the best first indicator of headroom.

The kernel documents Cached as in-memory file data plus tmpfs and shared-memory pages. MemAvailable is estimated from free pages, reclaimable slab, file-LRU pages and zone watermarks. Consequently, a machine can show a large buff/cache value and still have plenty of immediately usable memory.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What ps aux actually measures

ps aux prints one row per process using the user-oriented format. Among its columns are process ID, CPU percentage, memory percentage, virtual size (VSZ) and resident set size (RSS). These values describe a task, not the whole host.

Column Definition Common mistake
VSZ Virtual memory size, shown in KiB. It covers the process’s virtual address space, including mappings that have not been faulted into RAM. Calling VSZ “RAM used.” A program can reserve a large address range while touching only a small part of it.
RSS Resident, non-swapped physical pages currently associated with the task. Assuming RSS is a complete bill for every kernel resource caused by the process.
%MEM The task’s RSS divided by the machine’s physical memory. Expecting process percentages to add to the used line from free.

To get an explicit, sortable view, use:

ps -eo pid,comm,vsz,rss,%mem --sort=-rss

This sorts processes by displayed RSS. It does not make RSS additive: shared pages can still be counted in several rows, and kernel allocations that are not charged to a process row remain outside the list.

Why the numbers diverge

They have different scope

free -m accounts for the machine as a whole. Every process, the kernel, page cache, tmpfs, device mappings and swap contribute to that host view. Each ps row covers only one task. Comparing the host total with one row is therefore comparing different scopes; comparing the host total with a sum of rows still leaves accounting differences.

Linux uses memory for more than process pages

Host memory includes file page cache, filesystem and block-device buffers, reclaimable and unreclaimable slab objects, tmpfs, shared memory, page tables, kernel stacks, locked or pinned pages and other kernel-managed structures. These categories appear in /proc/meminfo and influence free, but they are not all represented as RSS in ps.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Virtual address space is not resident RAM

VSZ includes reserved address ranges, memory-mapped files, copy-on-write mappings, libraries and pages that have not yet been touched. A process may legitimately have a VSZ of many gigabytes while only a fraction is resident. Summing VSZ values is especially misleading because virtual ranges can overlap and do not correspond one-for-one with physical pages.

RSS counts shared pages once per mapping

If ten processes map the same shared library page, each process’s RSS can include that page. Adding the ten RSS values counts one physical page ten times. Shared-memory segments and shared file mappings create the same effect. The process list can therefore appear to consume more memory than the host physically has, even though the kernel has only one copy of many pages.

Proportional set size (PSS) addresses this specific problem. A shared page is divided among the processes that map it, so each process receives only its proportional share. PSS is the more useful measure when you need to apportion a shared workload, but it is not what ordinary ps aux displays.

Some per-process overhead is intentionally omitted

The ps manual states that SIZE and RSS do not include every process-related structure, including page tables, the kernel stack, struct thread_info and struct task_struct. The manual notes that the omitted resident amount is usually at least 20 KiB per process. Those structures are real memory costs, but they are not included in the RSS column you are adding.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The commands are snapshots, not one transaction

Both utilities read live procfs data. Processes allocate and release pages, the kernel fills or evicts cache, and swap activity can occur between commands. Running free -m and then ps aux captures two different instants. Rounding to megabytes or KiB can add a small visible discrepancy even when the underlying categories overlap.

Is RSS or VSZ the “real” RAM usage?

For physical memory currently resident in a process, RSS is the relevant starting point. It tells you how many non-swapped pages are resident for that task, whereas VSZ describes address-space commitments and mappings. Neither number is a complete answer to “how much memory would disappear if I stopped this process?” RSS may include pages shared with other processes, while VSZ may include pages that cost no RAM until accessed.

Use VSZ to spot large reservations, unusual mappings or address-space limits. Use RSS to rank immediate resident footprint. Use PSS from /proc/<pid>/smaps or smaps_rollup when you need a sharing-aware estimate. For a host-capacity decision, use MemAvailable and the other system counters rather than any single process column.

A practical workflow for reconciling memory

  1. Check host headroom first. Run free -m (or free -h) and read available, buff/cache, and both RAM and swap rows together. A high used value with substantial available often reflects reclaimable cache, not an emergency.
  2. Inspect the underlying categories. Read the relevant counters with:
    grep -E '^(MemTotal|MemFree|MemAvailable|Cached|SReclaimable|Slab|Shmem|SwapTotal|SwapFree):' /proc/meminfo

    MemTotal, MemAvailable, Cached, SReclaimable, Slab and Shmem explain why host usage can exceed what process RSS appears to show. SwapTotal and SwapFree show configured and unused swap.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  3. Rank resident processes. Run ps -eo pid,comm,vsz,rss,%mem --sort=-rss. Compare RSS with VSZ for each suspected process, but do not add VSZ and do not treat the RSS sum as a host total.
  4. Measure sharing when necessary. For a process ID, inspect /proc/<pid>/smaps_rollup when available, or /proc/<pid>/smaps. Look for Rss, Pss, and private/shared clean and dirty values. PSS apportions shared mappings and is better suited to comparing services that use common libraries.
  5. Investigate non-process categories. If the largest RSS values still do not explain low MemAvailable, examine slab growth, tmpfs usage, huge pages, locked or pinned memory, device mappings and filesystem caches through /proc/meminfo and workload-specific diagnostics.
  6. Repeat measurements under the same conditions. Capture both commands close together, record the time, and compare trends rather than a single pair of rounded snapshots. A short sampling script can run both commands repeatedly while a workload is active.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How to interpret common symptoms

“free says used is high, but RSS totals are modest”

First check available. If it remains healthy, page cache, reclaimable slab, tmpfs or shared memory probably accounts for much of the difference. If available is low, inspect Cached, SReclaimable, Shmem and swap counters to identify which host category is consuming capacity.

“The RSS percentages do not add to 100 percent”

%MEM is calculated per process from RSS and physical RAM. Shared pages may be counted in multiple rows, while caches and kernel allocations are absent from those rows. Percentages are therefore useful for ranking processes, not for reconstructing the free total.

Best Value
Sale
UNIX and Linux System Administration Handbook, 4th Edition
  • New
  • Mint Condition
  • Dispatch same day for order received before 12 noon
  • Guaranteed packaging
  • No quibbles returns

“VSZ is enormous, but the machine is not out of RAM”

Large virtual mappings can be reserved without backing every page with RAM. Check RSS, PSS and the process’s mappings before concluding that the virtual size represents physical consumption. Memory-mapped files and copy-on-write regions commonly make VSZ much larger than RSS.

“Swap is in use even though RAM appears available”

Linux can leave cold pages in swap while using free RAM for useful cache. Check SwapFree, MemAvailable and whether swap activity is ongoing. A nonzero swap-used value alone does not prove current memory pressure; sustained paging and falling available memory are stronger warning signs.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Which number should guide a decision?

  • Can I start another service? Use MemAvailable, swap activity and recent trends.
  • Which process is resident-heavy? Sort by RSS with ps.
  • How much address space is reserved? Inspect VSZ and mappings, while remembering that it is virtual.
  • How should shared memory be charged to services? Use PSS from smaps or smaps_rollup.
  • Where did host RAM go outside applications? Break down /proc/meminfo categories such as cache, slab, shmem and huge pages.

The apparent disagreement is therefore expected: free -m answers a host-capacity question, while ps aux answers a per-process mapping question. Select the metric whose scope and accounting model match the decision you are making, and do not turn either output into a total it was not designed to provide.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.