The following are the memory usage of
apache respectively on my server. As per the output of
mysql is using about 379M and
apache is using 277M.
[root@server ~]# pmap 10436 | grep total total 379564K [root@server ~]# pmap 10515 | grep total total 277588K
Comparing this with the output of
top, I see the values are almost matching.
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 10515 apache 20 0 271m 32m 3132 S 0.0 6.6 0:00.73 /usr/sbin/httpd 10436 mysql 20 0 370m 21m 6188 S 0.0 4.3 0:06.07 /usr/libexec/mysqld --basedir=....
Now these values definitely are not the current memory usage of those two processes, since if it were it would've exceeded the 512M
ram on my system and I understand the fact that these are the size of the pages assigned to these two processes and not really the size of the memory actively used by them. Now, when we use
pmap -x, I see an extra coloumn
Dirty which shows far less memory usage for the process. As seen in the example show below, the
Dirty coloumn shows 15M as opposed to 379M in the first coloumn. My question is: Is the value under coloumn
Dirty is the 'real' amount of memory actively used by that process? If its not, then how can we find out the real memory usage of a process? Not
top for the same reasons above. Do we have anything under
/proc that will give this info?
[root@server ~]# pmap -x 10436 | grep total total kB 379564 21528 15340 [root@server ~]# [root@server ~]# free -m total used free shared buffers cached Mem: 489 447 41 0 52 214 -/+ buffers/cache: 180 308 Swap: 1023 0 1023 [root@server ~]#