public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] mm: why cat /proc/pid/smaps | grep Rss is different from cat /proc/pid/statm?
@ 2016-03-22 13:55 Xishi Qiu
       [not found] ` <CALvZod5PnHz5OsNrcfsMZ6=cxLBy9436htbKerv67S+CigwGbQ@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Xishi Qiu @ 2016-03-22 13:55 UTC (permalink / raw)
  To: Linux MM, LKML

[root@localhost c_test]# cat /proc/3948/smaps | grep Rss
Rss:                   4 kB
Rss:                   4 kB
Rss:                   4 kB
Rss:                 796 kB
Rss:                   0 kB
Rss:                  16 kB
Rss:                   8 kB
Rss:                  12 kB
Rss:                 132 kB
Rss:                  12 kB
Rss:                   4 kB
Rss:                   4 kB
Rss:                   4 kB
Rss:                   4 kB
Rss:                  12 kB
Rss:                   0 kB
Rss:                   4 kB
Rss:                   0 kB
[root@localhost c_test]# cat /proc/3948/statm
1042 173 154 1 0 48 0

173 means Rss is 173*4kb=692kb, right?
so why it is different from the sum(1020kb) of "cat /proc/pid/smaps | grep Rss"?

my test code is
...
int main()
{
	sleep(1000);
	return 0;
}

the kernel version is v4.1

Thanks,
Xishi Qiu

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-30  9:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-22 13:55 [RFC] mm: why cat /proc/pid/smaps | grep Rss is different from cat /proc/pid/statm? Xishi Qiu
     [not found] ` <CALvZod5PnHz5OsNrcfsMZ6=cxLBy9436htbKerv67S+CigwGbQ@mail.gmail.com>
2016-03-30  7:16   ` Xishi Qiu
2016-03-30  9:39     ` Xishi Qiu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox