/proc/<pid>/statm 中“页面”的单位是什么

jbc*_*res 4 linux ubuntu memory-usage

根据 proc(5) 的 linux 手册页:

/proc/[pid]/statm 提供有关内存使用情况的信息,以页为单位。列是:

size       (1) total program size
           (same as VmSize in /proc/[pid]/status)
resident   (2) resident set size
           (same as VmRSS in /proc/[pid]/status)
share      (3) shared pages (i.e., backed by a file)
text       (4) text (code)
lib        (5) library (unused in Linux 2.6)
data       (6) data + stack
dt         (7) dirty pages (unused in Linux 2.6)
Run Code Online (Sandbox Code Playgroud)

如果我将结果与 ubuntu 系统监视器进行比较,单位似乎是 Mb,但我不是 100% 确定。“以页为单位”是什么意思?

HBr*_*ijn 6

页面大小是 Linux 内核使用的内存分配/寻址单位。

你找出它的大小(以字节为单位) getconf PAGESIZE

4096 = 4kB 是默认值。