|
Our measurement problemOur measurement problemPosted Aug 4, 2005 5:07 UTC (Thu) by JoeBuck (subscriber, #2330)In reply to: Our bloat problem by hp Parent article: Our bloat problem One of the more embarrassing problems is that we don't really have tools that can give us an accurate picture of the problem. Everyone will tell you that "top" doesn't give an accurate picture, and everyone is right. The difficulty is that there is at present no tool that really shows what is going on. Before we can really improve things, we need better measurement tools. Remember how much faster the boot times got after some guy did bootchart? Back in the early 80s, VMS had a "graphical" (termcap-style) tool that would show a real-time animation of every page in memory, tracing it to the corresponding executable or shared library or kernel. The modern extension would show memory-mapped files, cached files, etc. as well. If we could just have those pictures, people's attention would quickly focus on the hot spots.
(Log in to post comments)
Our measurement problem Posted Aug 4, 2005 7:13 UTC (Thu) by freddyh (guest, #21133) [Link] I do agree that there is not really a tool that *easily* shows the memory problem. Atkins however can teach you exactly what your application is doing, including its memory usage.Unfortunately you'll have to dig in yourself, and the first time will cost you quite some time.
FreddyH
Our measurement problem Posted Aug 4, 2005 12:45 UTC (Thu) by MathFox (subscriber, #6104) [Link] 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?
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.