Bug 192613 - Inconsistent /proc/<pid>/statm and /proc/<pid>/status
Summary: Inconsistent /proc/<pid>/statm and /proc/<pid>/status
Keywords:
Status: CLOSED DUPLICATE of bug 192612
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:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-05-21 21:39 UTC by Vamsi Krishna
Modified: 2007-11-30 22:07 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-05-22 21:53:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Vamsi Krishna 2006-05-21 21:39:22 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.

Please let us know what excatly is the actual VmSize.

Best Regards
Vamsi kundeti

Comment 1 Ernie Petrides 2006-05-22 21:53:55 UTC
This is apparently an accidental double bug entry.


*** This bug has been marked as a duplicate of 192612 ***


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