Hi Brady,
On 7/20/05, P@xxxxxxxxxxxxxx <P@xxxxxxxxxxxxxx> wrote:
The following shell gets the shared values for the
first httpd process:
FIRST_HTTPD=`ps -C httpd -o pid= | head -1 | tr -d ' '`
HTTPD_STATM_SHARED=$(expr 4 '*' `cut -f3 -d' ' /proc/$FIRST_HTTPD/statm`)
HTTPD_SMAPS_SHARED=$(grep Shared /proc/$FIRST_HTTPD/smaps | tr -s ' '
| cut -f2 -d' ' | ( tr '\n' +; echo 0 ) | bc)
This shows that "smaps" reports 3060 KB more shared mem than "statm".
However adding up all the anon sections in smaps only gives 2456 KB?
You are adding up all Shared_Clean and Shared_Dirty as Shared, right?
When doing this I also noticed that there are duplicate
entries in smaps. Any ideas why?
Each pair of address per line indicates the start and end address of a
memory area (VMA) such as:
b7f7d000-b7f7e000
This means that an specific memory area start on virtual address b7f7d000 and end on b7f7e000 .
An mapped file like /lib/ld-2.3.3.so is organized in different memory
areas. The memory area can be a text section, data section or bss. So
it is normal you find the same filename mapped in more than one memory
area.
grep -F - /proc/$FIRST_HTTPD/smaps | sort | uniq -d -c