Understanding Linux ram use :: pmap vs ps :: xorg memory
Posted: Mar 9, 06, 20:47 techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Location: East Coast, West Coast? I know it's one of them.
Came across this article while researching xorg memory consumption.
:: Quote ::Unfortunately, a perfect representation of process memory usage isn't easy to obtain. Not only do you need to understand how the system really works, but you need to decide how you want to deal with some hard questions. Should a shared library that is only needed for one process be counted in that process's memory usage? If a shared library is used my multiple processes, should its memory usage be evenly distributed among the different processes, or just ignored? There isn't a hard and fast rule here; you might have different answers depending on the situation you're facing. It's easy to see why ps doesn't try harder to report "correct" memory usage totals, given the ambiguity.
To take a close look at memory useage, try pmap - replace <process number> with the numeric pid, process number.
:: Code ::pmap -d <process number>
In the example below, I got the pid number by running top.
and you'll get some output like this, firefox in this case:
:: Code ::username@machinename:~$ pmap -d 6909
6909: /usr/lib/firefox/firefox-bin -a firefox
Address Kbytes Mode Offset Device Mapping
08048000 10900 r-x-- 0000000000000000 008:00002 firefox-bin
08aed000 100 rw--- 0000000000aa5000 008:00002 firefox-bin
08b06000 66616 rw--- 0000000008b06000 000:00000 [ anon ]
b059b000 4 ----- 00000000b059b000 000:00000 [ anon ]
b059c000 8188 rwx-- 00000000b059c000 000:00000 [ anon ]
that's not all of it, I cut off the last section to keep it shorter, this is just to give you an idea.
Re xorg memory consuption, is it firefox as culprit? or graphics applications?
Slashdot had this, luckily the first comment in the thread...
:: Quote ::It could also have mentioned mappings on /dev. For example, the X server, on a system with a 256MB graphics adapter, will map all that memory into its address space, making X look huge, even though it's not using all that much system RAM. This will show up as a device-backed mapping in the maps file.
On a related note, X also looks big because it's holding pixmaps belonging to various applications (Firefox comes to mind).
and further along:
:: Quote ::Device mappings show up as consumed memory (which generates plenty of XFree86/xorg complaints). If you want to find out how much memory xorg/X11 is actually using (bytes in cached pixmaps on behalf of each process and sans device mappings), try this [126.96.36.199] program (contains a tiny program that lists how much memory X is using for other programs by caching pixmaps and a perl script that lists how much memory X is using sans device mappings).
Back to top
All times are GMT - 8 Hours