Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

My script uses 8mbs when it is run under mod_perl

CGI Imager and Image::Size are all preloaded. When I run perl status on my script it says 2.5mb is the total memory used. So why does it take 8mb then? That is a big increase. I wish I had more max clients :(

I wanted to try and preload my scripts using apache::registryloader but the people who run my server will not install apache with that.

Any help would be appreciated.

Replies are listed 'Best First'.
Re: Memory Size in Mod_Perl
by perrin (Chancellor) on Jul 09, 2005 at 00:43 UTC
    What are you looking at that makes you think it takes 8MB? There is actually no way to tell how much physical memory a process is taking on modern Linux distributions, because top doesn't accurately reflect memory shared through copy-on-write. You can get more information about this from the mod_perl docs and by joining the mod_perl mailing list.

    By the way, you already have Apache::RegistryLoader, although you may not have permission to modify your server's conf file.

      I have permission to modify the conf file, but they tell me it wasn't installed with apache and it would require a reinstall which they will not do.
        Apache::RegistryLoader is part of the mod_perl distribution, so it's there unless they specifically removed it. Try looking for it.
Re: Memory Size in Mod_Perl
by Anonymous Monk on Jul 09, 2005 at 01:37 UTC
    I have also heard of a bug that will dbl the memory size? I only saw it on one website awhile ago and just remembered about it. Not sure if that is real or not.