[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Memory usage mesurements via smaps interface



Hi debian-kernel users

I need to get a reasonably accurate measurement of the size of resident srahed and private memory a generic process occupies in a given moment (debian standard kernel 2.6.18).

Having read a lot of documentation, users reports and seeing the kernel offers various interfaces for this pourpose, i've come to the conclusion that the smaps interface should offer the most accurate results.

I was thnking about using something like

cat /proc/$PID/smaps|grep $WHAT | awk 'BEGIN{TOT=0}{TOT=TOT+$2}END{print TOT" KB"}'

to get the two sums i need, where WHAT is set in turn to Private_ and then Shared_

Do you believe this method will give me the mesurement accuracy i need?

Thanks

Attilio



Reply to: