linux-mm.kvack.org archive mirror
 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
  2016-03-22 14:47 ` Shakeel Butt
  0 siblings, 1 reply; 4+ 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

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

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

Thread overview: 4+ 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
2016-03-22 14:47 ` Shakeel Butt
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;
as well as URLs for NNTP newsgroup(s).