monit-dev
[Top][All Lists]
Advanced

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

total memory of children processes


From: Arkadiusz Miskiewicz
Subject: total memory of children processes
Date: Wed, 10 Sep 2003 17:45:16 +0200
User-agent: KMail/1.5.3

Hi,

Total memory of children processes seems miscalculated:
Event: total mem amount of 12193680kB matches resource limit [total mem 
amount>512001kB]

ok but this machine has only 512MB ram and 2GB of swap.

The problem seems be that only rss (resident set size) value is used. rss also 
includes memory shared between processes.

IMO algoritm to calculate total mem amount should looke like:

rss of parent + (rss of first child - shared mem, rss of second chold - shared 
mem and so on). It's still not perfect because we don't know between which 
processes that memory is shared but it's much better than adding whole rss.

shared memory can be found in /proc/$pid/statm.

On my server for httpd proces it's:
address@hidden root]# pmap -x 22746 |less
22746:   httpd -4
Address       kB Resident Shared Private Permissions       Name
00110000      80       -       0      80 read/exec         ld-2.2.5.so
00124000       4       -       0       4 read/write        ld-2.2.5.so
00125000       8       -       0       8 read/write         [ anon ]
00128000       4       -       0       4 read/exec         mod_asis.so
[...]
01142000     980       -     980       0 read/write        mod_jk2.shm
01237000     980       -     980       0 read/write        mod_jk2.shm
0132c000     508       -     508       0 read/write        SYSV00000000 
(deleted)
013ab000     364       -     364       0 read/write        SYSV00000000 
(deleted)
08048000     212       -       0     212 read/exec         httpd
0807d000      32       -       0      32 read/write        httpd
08085000   63820       -       0   63820 read/write/exec    [ anon ]
40000000   32768       -   32768       0 read/write        SYSV00000000 
(deleted)
42000000   32768       -   32768       0 read/write        SYSV00000000 
(deleted)
bfff5000      44       -       0      44 read/write/exec    [ anon ]
--------  ------  ------  ------  ------
total kB  148912       -   71360   77552

so almost half of memory used by this process is shared between httpd (and 
other) processes...

Comments?
-- 
Arkadiusz Miƛkiewicz    CS at FoE, Wroclaw University of Technology
arekm.pld-linux.org AM2-6BONE, 1024/3DB19BBD, arekm(at)ircnet, PLD/Linux





reply via email to

[Prev in Thread] Current Thread [Next in Thread]