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โ readablewrโ writableexโ executableshโ sharedmrโ may readmwโ may writemeโ may executemsโ may sharegdโ stack segment grows downpfโ pure PFN rangedwโ disabled write to the mapped fileloโ pages are locked in memoryioโ memory mapped I/O areasrโ sequential read advise providedrrโ random read advise provideddcโ do not copy area on forkdeโ do not expand area on remappingacโ area is accountablenrโ swap space is not reserved for the areahtโ area uses huge tlb pagessfโ perform synchronous page faults (since Linux 4.15)nlโ non-linear mapping (removed in Linux 4.0) ๐arโ architecture specific flagwfโ wipe on fork (since Linux 4.14)ddโ do not include area into core dumpsdโ soft-dirty flag (since Linux 3.13)mmโ mixed map areahgโ huge page advise flagnhโ no-huge page advise flagmgโ mergeable advise flagumโ 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
- Copyright 1994-1995, Daniel Quinlan <Daniel.Quinlan@linux.org>
- Copyright 2002-2017, Michael Kerrisk <mtk.manpages@gmail.com>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms