proc_pid_smaps(5)

๐Ÿ’– proc_pid_smaps โ€” bestie's guide to /proc/pid/smaps and /proc/pid/smaps_rollup ๐Ÿ’–

okay so this is a page from section 5 of the manual (File Formats Manual, periodt) and it's all about peeking at how much memory your process is actually using. it's giving detective energy ๐Ÿ”โœจ


๐ŸŒธ NAME ๐ŸŒธ

/proc/pid/smaps, /proc/pid/smaps_rollup โ€” the size of your mapped memory regions, bestie ๐Ÿ’…


โœจ SYNOPSIS โœจ

/proc/pid/smaps
/proc/pid/smaps_rollup

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

๐ŸŽ€ /proc/pid/smaps (since Linux 2.6.14) ๐ŸŽ€

This file shows you the memory consumption for each of the process's mappings, one by one. no cap. ๐Ÿซถ

(btw the pmap(1) command shows you kinda the same info, in a form that might be easier for parsing โ€” so if you're scripting it up, that's an option, iykyk.)

Permission to access this file is governed by CAP_PERFMON (since Linux 6.15) or a ptrace access mode PTRACE_MODE_READ_FSCREDS check; see ptrace(2). so like, you can't just waltz in there, bestie ๐Ÿ™ˆ

For each mapping there's a series of lines, and they look a lil somethin' like this:

00400000-0048a000 r-xp 00000000 fd:03 960637       /bin/bash
Size:                552 kB
Rss:                 460 kB
Pss:                 100 kB
Shared_Clean:        452 kB
Shared_Dirty:          0 kB
Private_Clean:         8 kB
Private_Dirty:         0 kB
Referenced:          460 kB
Anonymous:             0 kB
AnonHugePages:         0 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
Swap:                  0 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Locked:                0 kB
ProtectionKey:         0
VmFlags: rd ex mr mw me dw

The first one of those lines shows the same information as what's displayed for the mapping in /proc/pid/maps. iconic. Then the following lines are:

  • the size of the mapping
  • the amount of the mapping that's currently resident in RAM ("Rss" โ€” resident set size, the glow-up stat)
  • the process's proportional share of this mapping ("Pss")
  • the number of clean and dirty shared pages in the mapping
  • the number of clean and dirty private pages in the mapping

"Referenced" tells you the amount of memory that's currently marked as referenced or accessed. "Anonymous" shows the amount of memory that doesn't belong to any file at all โ€” it's just vibing on its own. and "Swap" shows how much would-be-anonymous memory is also used, but out on swap (she got sent away ๐Ÿ˜ญ).

The "KernelPageSize" line (available since Linux 2.6.29) is the page size the kernel uses to back the virtual memory area. This matches the size used by the MMU in the majority of cases. However โ€” one counter-example occurs on PPC64 kernels, whereby a kernel using 64 kB as a base page size may still use 4 kB pages for the MMU on older processors. to tell those two attributes apart, the "MMUPageSize" line (also available since Linux 2.6.29) reports the page size used by the MMU. two separate receipts, bestie ๐Ÿงพ

The "Locked" line indicates whether the mapping is locked in memory or not. ๐Ÿ”’

The "ProtectionKey" line (available since Linux 4.9, on x86 only) contains the memory protection key (see pkeys(7)) associated with the virtual memory area. heads up: this entry is present only if the kernel was built with the CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS configuration option (since Linux 4.6). no option, no line, periodt.

The "VmFlags" line (available since Linux 3.8) represents the kernel flags associated with the virtual memory area, encoded using these two-letter codes, and yes we're listing every single one because they all ate:

  • rd โ€” readable
  • wr โ€” writable
  • ex โ€” executable
  • sh โ€” shared
  • mr โ€” may read
  • mw โ€” may write
  • me โ€” may execute
  • ms โ€” may share
  • gd โ€” stack segment grows down
  • pf โ€” pure PFN range
  • dw โ€” disabled write to the mapped file
  • lo โ€” pages are locked in memory
  • io โ€” memory mapped I/O area
  • sr โ€” sequential read advise provided
  • rr โ€” random read advise provided
  • dc โ€” do not copy area on fork
  • de โ€” do not expand area on remapping
  • ac โ€” area is accountable
  • nr โ€” swap space is not reserved for the area
  • ht โ€” area uses huge tlb pages
  • sf โ€” perform synchronous page faults (since Linux 4.15)
  • nl โ€” non-linear mapping (removed in Linux 4.0) ๐Ÿ’€
  • ar โ€” architecture specific flag
  • wf โ€” wipe on fork (since Linux 4.14)
  • dd โ€” do not include area into core dump
  • sd โ€” soft-dirty flag (since Linux 3.13)
  • mm โ€” mixed map area
  • hg โ€” huge page advise flag
  • nh โ€” no-huge page advise flag
  • mg โ€” mergeable advise flag
  • um โ€” userfaultfd missing pages tracking (since Linux 4.3)
  • uw โ€” userfaultfd wprotect pages tracking (since Linux 4.3)

The /proc/pid/smaps file is present only if the CONFIG_PROC_PAGE_MONITOR kernel configuration option is enabled. no config, no file, that's the vibe check ๐Ÿšซ


๐ŸŒˆ /proc/pid/smaps_rollup (since Linux 4.14) ๐ŸŒˆ

This file is similar to /proc/pid/smaps, except all the mappings are merged into a single synthetic entry. so instead of forty little entries you get one big summary โ€” it's giving main character energy ๐Ÿ‘‘


๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘


๐Ÿ’– okay that's the whole page, bestie! this one's from Linux man-pages 6.20, dated 2026-09-17, and honestly she served. go check your RSS now, slay, and remember: the vibe changes, the facts do not ๐Ÿ’…โœจ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from
  • arch rolling: man-pages 6.20-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • ๐Ÿ“œ the page's license: GPL-3.0-or-later
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms