Linux memory system is filled with many routines of memory optimization utilities and memory sharing, making the very idea of how memory is shared and being consumed among, a cumbersome approach.The output of ps and other ps related commands all work up their output from data under /proc
filesystem. Particularly ps
, RSS(resident size memory) and VSIZE(Virtual memory size) are both important, however VSIZE does not show the accurate usage of the memory and the difference between VSIZE and rss is what is actually intended and allocated to the program during the initialization but may not be referenced yet.
Like the program may have lots of libraries linked but they are not loaded yet because they are not referenced yet in the actual program runtime. RSS gives the total memory actually used by the program but may not give a true picture of the memory consumption, since most of the memory allocated may be shared with other instances of the same process or other processes. Looking under /proc/<processid>/maps
may give a rough idea of how the memory has been used but they quiet can be misleading sometimes. Use pmap -x <pid>
from commandline, useful to see the spreadup is.
The often better utilities are free
and vmstat
. free
will give you overall current memory consumption details and vmstat can be used to see how often it is being updated.
top
on IOS doesn't include shared objects in vsize, or something. – Tim Kennedy Oct 02 '11 at 04:52