aboutsummaryrefslogtreecommitdiffstats
path: root/man/man5/proc_pid_smaps.5
blob: f4b6bc981cb2d2eb4c43e178370a829ec429492a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
'\" t
.\" Copyright, the authors of the Linux man-pages project
.\"
.\" SPDX-License-Identifier: GPL-3.0-or-later
.\"
.TH proc_pid_smaps 5 (date) "Linux man-pages (unreleased)"
.SH NAME
/proc/pid/smaps \- XXX: What does 's' in "smaps" stand for?
.SH DESCRIPTION
.TP
.IR /proc/ pid /smaps " (since Linux 2.6.14)"
This file shows memory consumption for each of the process's mappings.
(The
.BR pmap (1)
command displays similar information,
in a form that may be easier for parsing.)
For each mapping there is a series of lines such as the following:
.IP
.in +4n
.EX
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
.EE
.in
.IP
The first of these lines shows the same information as is displayed
for the mapping in
.IR /proc/ pid /maps .
The following lines show the size of the mapping,
the amount of the mapping that is currently resident in RAM ("Rss"),
the process's proportional share of this mapping ("Pss"),
the number of clean and dirty shared pages in the mapping,
and the number of clean and dirty private pages in the mapping.
"Referenced" indicates the amount of memory currently marked as
referenced or accessed.
"Anonymous" shows the amount of memory
that does not belong to any file.
"Swap" shows how much
would-be-anonymous memory is also used, but out on swap.
.IP
The "KernelPageSize" line (available since Linux 2.6.29)
is the page size used by the kernel 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 distinguish the two attributes, the "MMUPageSize" line
(also available since Linux 2.6.29)
reports the page size used by the MMU.
.IP
The "Locked" indicates whether the mapping is locked in memory
or not.
.IP
The "ProtectionKey" line (available since Linux 4.9, on x86 only)
contains the memory protection key (see
.BR pkeys (7))
associated with the virtual memory area.
This entry is present only if the kernel was built with the
.B CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
configuration option (since Linux 4.6).
.IP
The "VmFlags" line (available since Linux 3.8)
represents the kernel flags associated with the virtual memory area,
encoded using the following two-letter codes:
.RS
.IP
.TS
l l.
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)
.TE
.RE
.IP
The
.IR /proc/ pid /smaps
file is present only if the
.B CONFIG_PROC_PAGE_MONITOR
kernel configuration option is enabled.
.SH SEE ALSO
.BR proc (5)