Apache/2.0.55 (Debian) mod_perl/2.0.2 Perl/v5.8.8

I'm testing out a Catalyst application running under mod_perl (was
using fastcgi before).  I'm trying to get a grasp on the memory used
by the processes.


Anyone familiar with pmap on linux?  There's this description of using
pmap to determine shared memory of a process:

    
http://virtualthreads.blogspot.com/2006/02/understanding-memory-usage-on-linux.html

But, I'm seeing different values from GTop.  GTop is showing about 25M
shared, where pmap is only showing 5.7M shared.

I tend (and hope!) to believe GTop.  But, now I'm wondering what's
the difference.  Can anyone explain?



I'm also using a mmapped cache file for sessions.  So, I'm not clear
how that is counted, if at all.  Granted, it's not that big:

$ ls -lh /tmp/ws2_session-0
-rw-r----- 1 root root 5.6M 2006-05-01 07:05 /tmp/ws2_session-0

But I'm wondering if that's counted in the memory of each process,
and in GTop's shared count.



The other somewhat curious thing is that I'm not seeing any difference
in memory when I preload modules.  Granted, I'm using Catalyst which
has a setup() method that brings in most code at module load time.
Do you think that accounts for the similar results below?

I'm preloading about 300 modules.  (I just dumpped %INC for my tests.)


In this first test I'm using PerlLoadModule:


    total = 905892K
    shared =  0K
    used = 845768K
    free = 60124K
    21229 size = 63008k
    21229 vsize = 63008k
    21229 resident = 44856k
    21229 share = 24752k
    21229 rss = 44856k

    pmap -d 21229 | grep write
    mapped: 63012K    writeable/private: 39836K    shared: 5752K


Loading 360 in startup.pl as "use Foo ();"

    total = 905892K
    shared =  0K
    used = 865904K
    free = 39988K
    21873 size = 62936k
    21873 vsize = 62936k
    21873 resident = 44800k
    21873 share = 24752k
    21873 rss = 44800k

    pmap -d 21873 | grep write
    mapped: 62940K    writeable/private: 39764K    shared: 5752K


Only PerlLoadModule one module -- the main Catalyst application
module:

    total = 905892K
    shared =  0K
    used = 857464K
    free = 48428K
    22024 size = 61628k
    22024 vsize = 61628k
    22024 resident = 43528k
    22024 share = 24752k
    22024 rss = 43528k

    pmap -d 22024 | grep write
    mapped: 61632K    writeable/private: 38456K    shared: 5752K

Not much difference.



-- 
Bill Moseley
[EMAIL PROTECTED]

Reply via email to