You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Doug MacEachern <do...@covalent.net> on 2000/12/20 09:18:24 UTC

Re: Loading modules in Parent??

On Thu, 28 Sep 2000, Bill Moseley wrote:

> Hi,
> 
> I'm seeing the opposite results from pre-loading modules in the parent
> process than I would expect.  It looks like pre-loading modules ends up
> using more non-shared ("private") memory.
...
> Here's the pre-loaded module list. When running as non-pre-loaded I'm
> commenting out Search, SWISH::Fork, and CGI->compile lines below.  That's
> the only difference. 

that's a BIG difference.

% perlbloat 'require CGI'
require CGI added  784k

% perlbloat 'require CGI; CGI->compile(":all")'
require CGI; CGI->compile(":all") added  2.0M

try without preloading CGI.pm/CGI->compile in either.

p.s. this is the perlbloat script:

use GTop ();

my $gtop = GTop->new;
my $before = $gtop->proc_mem($$)->size;

for (@ARGV) {
    if (eval "require $_") {
        eval {
            $_->import;
        };
    }
    else {
        eval $_;
        die $@ if $@;
    }
}

my $after = $gtop->proc_mem($$)->size;

printf "@ARGV added %s\n", GTop::size_string($after - $before);