Bug 192612 - Inconsistent /proc/<pid>/statm and /proc/<pid>/status
Summary: Inconsistent /proc/<pid>/statm and /proc/<pid>/status
Status: CLOSED CANTFIX
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel
Version: 3.0
Hardware: i686
OS: Linux
medium
high
Target Milestone: ---
Assignee: Red Hat Kernel Manager
QA Contact: Brian Brock
URL:
Whiteboard:
Keywords:
: 192613 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-05-21 21:38 UTC by Vamsi Krishna
Modified: 2007-11-30 22:07 UTC (History)
2 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2007-09-13 12:40:53 UTC


Attachments (Terms of Use)

Description Vamsi Krishna 2006-05-21 21:38:34 UTC
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 21:52:18 UTC
RHEL3 is now closed.

Comment 2 Ernie Petrides 2006-05-22 21:54:39 UTC
*** Bug 192613 has been marked as a duplicate of this bug. ***

Comment 3 Prarit Bhargava 2007-09-13 12:40:53 UTC
Closing re: comment #1.

P.


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