|
Our measurement problemOur measurement problemPosted Aug 4, 2005 12:45 UTC (Thu) by MathFox (subscriber, #6104)In reply to: Our measurement problem by JoeBuck Parent article: Our bloat problem
Well "cat /proc/<pid>/maps" allready gives you a lot of information:
$ cat /proc/self/maps
This shows a quite lean program, in order of the lines:
(each page on this machine is 4 kb)
Most of the apparent bloat for cat (850 pages * 4 k = 3.4 Mb) is in localisation and the shared C library. All but 16 pages (64 k) are shared with other processes.
Who writes a nice graphical frontend to /proc/*/maps?
(Log in to post comments)
Our measurement problem Posted Aug 4, 2005 14:59 UTC (Thu) by Yorick (subscriber, #19241) [Link] It is not possible from /proc/$pid/maps to find out how many pages of a mapped file have beenprivately modified (.data sections etc). This would be a useful addition, but because of the lack of forethought it can be difficult to add it to this pseudo-file without breaking existing programs.
It is also not possible to find the set of actually shared pages from a mapped file - just because
We definitely need better memory usage metrics from the kernel, or bloat like this will be difficult
Our measurement problem Posted Aug 6, 2005 14:00 UTC (Sat) by sandmann (subscriber, #473) [Link] The kernel actually has a system call - mincore - that tells you which pages of a mapped file are in memory. I wrote a small program a long time ago that uses it to print more details about memory usage:
http://www.daimi.au.dk/~sandmann/freon.c
You have to be root to run it.
Unfortunately a similar thing can't be done for malloc()d memory because mincore doesn't work for anonymous pages.
|
Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds
Powered by Rackspace Managed Hosting.