Confusion: Process size from /proc/XX/status vs. /proc/XX/statm

Nate Eldredge (nate@cartsys.com)
Fri, 02 Apr 1999 12:03:24 -0800


I notice that both /proc/XX/status and /proc/XX/statm both provide a
field for process size. VmSize for the former, the first value for the
latter (as apparently stated by Documentation/proc.txt). However, they
don't match (and yes, I know one is K and the other pages).

For example, here is the output of each. It may or may not be relevant
that the process in question had a lot of pages protected PROT_NONE.

unixbox:~/progs/yamd$ cat /proc/1271/status
Name: cc1
State: T (stopped)
Pid: 1271
PPid: 1270
Uid: 1004 1004 1004 1004
Gid: 100 100 100 100
Groups: 100 5 6 11 101 102 103 107 110
VmSize: 132652 kB
VmLck: 0 kB
VmRSS: 45416 kB
VmData: 129536 kB
VmStk: 52 kB
VmExe: 2044 kB
VmLib: 976 kB
SigPnd: 0000000000000000
SigBlk: 0000000000000000
SigIgn: 0000000000000000
SigCgt: 0000000000001480
CapInh: 00000000fffffeff
CapPrm: 0000000000000000
CapEff: 0000000000000000
unixbox:~/progs/yamd$ cat /proc/1271/statm
16835 11354 577 442 0 10912 10777

Note that 16835 * 4 = 67340 != 132652.

So I'm confused. Should the two be equal and it's a bug that they
aren't, or are they intended to measure different things? If the
latter, what are the semantics of each?

TIA

-- 

Nate Eldredge nate@cartsys.com

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/