I want to get a full added amount of memory usage for a particular process. Here say I want to have the total amount of memory taken by httpd. So if I do a tail command as "tail -M" I get
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 10036 mysql 20 0 417m 76m 3820 S 0.3 15.5 0:13.55 mysqld 10453 apache 20 0 229m 67m 42m S 0.0 13.7 0:10.81 httpd 10447 apache 20 0 230m 64m 38m S 0.0 13.0 0:11.54 httpd 10479 apache 20 0 226m 64m 42m S 0.0 13.0 0:09.75 httpd 10478 apache 20 0 230m 63m 38m S 0.0 12.9 0:11.02 httpd 10451 apache 20 0 230m 63m 37m S 0.0 12.8 0:10.37 httpd 9599 apache 20 0 227m 61m 38m S 0.0 12.4 0:10.80 httpd 10454 apache 20 0 226m 60m 38m S 0.0 12.2 0:09.56 httpd 10476 apache 20 0 225m 58m 38m S 0.0 11.9 0:09.87 httpd 10332 apache 20 0 228m 50m 24m S 0.0 10.2 0:13.73 httpd 10445 apache 20 0 220m 42m 24m S 0.0 8.5 0:10.17 httpd 637 root 10 -10 32816 25m 1712 S 0.0 5.2 0:00.01 iscsiuio 652 root 10 -10 5128 2972 1876 S 0.0 0.6 0:05.86 iscsid 9592 root 20 0 207m 2872 900 S 0.0 0.6 0:00.39 httpd 10196 nobody 20 0 136m 2408 500 S 0.0 0.5 0:00.79 memcached
In this case I want to have the "VIRT", "RES", "SHR", "%CUP", & "%MEM" totally as added for each rows of the output.
Is there anyway I can do that?


