Bug 192612 - Inconsistent /proc/<pid>/statm and /proc/<pid>/status
Inconsistent /proc/<pid>/statm and /proc/<pid>/status
Status: CLOSED CANTFIX
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel (Show other bugs)
3.0
i686 Linux
medium Severity high
: ---
: ---
Assigned To: Red Hat Kernel Manager
Brian Brock
:
: 192613 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-05-21 17:38 EDT by Vamsi Krishna
Modified: 2007-11-30 17:07 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-09-13 08:40:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Vamsi Krishna 2006-05-21 17:38:34 EDT
Description of problem:

Hello,

There seems to be some problem with the consistency of the memory reporting for
a process when we use /proc/<pid/statm file, to report the memory.

The VmSize in the /proc/<pid>/status file should be excatly 4 times the first
entry in the /proc/<pid>/statm file. (Since statm reports in pages and page
size= 4Kb).

But see the following output of status and statm files on ally RHEL-3.0 platforms.

-------------------------------
$cat /proc/self/status

Name:	csh
State:	R (running)
Tgid:	20664
Pid:	20664
PPid:	20663
TracerPid:	0
Uid:	6207	6207	6207	6207
Gid:	30	30	30	30
FDSize:	32
Groups:	30 2034 31 
VmSize:	    5048 kB
VmLck:	       0 kB
VmRSS:	    1748 kB
VmData:	     960 kB
VmStk:	     164 kB
VmExe:	     292 kB
VmLib:	    1488 kB
SigPnd:	0000000000000000
ShdPnd:	0000000000000000
SigBlk:	0000000000010002
SigIgn:	0000000000384004
SigCgt:	0000000009812003
CapInh:	0000000000000000
CapPrm:	0000000000000000
CapEff:	0000000000000000


$cat /proc/self/statm
437 437 245 71 20 346 0

In the above RSS size turns out to be the same but VmSize i.e size varies.

Also found a bug in proc documentation, it says the order of the fields in
/proc/<pid>/statm file is 

size
resident
share
trs
drs
lrs
dt

when I checked up in fs/proc/array.c its printed in the order

size
resident
share
trs
lrs
drs
dt



Version-Release number of selected component (if applicable):


How reproducible:

$uname --all

Linux  2.4.21-32.ELhugemem #1 SMP Fri Apr 15 21:04:31 EDT 2005 i686 i686 i386
GNU/Linux


Steps to Reproduce:
1.
2.
3.
  
Actual results:
o Inconsistent VMSIZE when we read from /proc/<pid>/status and /proc/<pid>/statm/

Expected results:

o Both the VmSize in status file and statm file should be the same.

Additional info:
Comment 1 Ernie Petrides 2006-05-22 17:52:18 EDT
RHEL3 is now closed.
Comment 2 Ernie Petrides 2006-05-22 17:54:39 EDT
*** Bug 192613 has been marked as a duplicate of this bug. ***
Comment 3 Prarit Bhargava 2007-09-13 08:40:53 EDT
Closing re: comment #1.

P.

Note You need to log in before you can comment on or make changes to this bug.