Problem with perl-status memory usage

2007-09-12 Thread Richard Jones
Have setup perl-status according to the information in Practical 
mod_perl (Ch9.4), and am using Apache/2.2.3 mod_perl/2.0.2 on a Linux 
system running the XAMPP package. All perl-status functions seem to work 
OK, except memory usage which generates a 500 error:


[Wed Sep 12 11:45:59 2007] [error] [client 127.0.0.1] Can't locate 
object method "rnew" via package "Devel::Symdump" (perhaps you forgot to 
load "Devel::Symdump"?) at 
/opt/lampp/lib/perl5/site_perl/5.8.7/i686-linux/B/TerseSize.pm line 
632.\n, referer: http://xxx.xxx.xxx.xxx/perl-status


The mod_perl enabled XAMPP Apache server is listening on localhost:81 
for addresses ProxyPass'd from a front-end Apache server.


Both packages referred to in the error message are installed and up to date:

B::TerseSize is up to date (0.09)
Devel::Symdump is up to date (2.07)

I can't find anything previously about this. Does anyone have any ideas?
--
Richard Jones


Re: Problem with perl-status memory usage

2007-09-12 Thread Perrin Harkins
On 9/12/07, Richard Jones <[EMAIL PROTECTED]> wrote:
> Both packages referred to in the error message are installed and up to date

Do you have more than one perl on this system?  Maybe XAMPP installs a
separate one.

- Perrin


Re: Problem with perl-status memory usage

2007-09-12 Thread Richard Jones

Perrin Harkins wrote:

On 9/12/07, Richard Jones <[EMAIL PROTECTED]> wrote:

Both packages referred to in the error message are installed and up to date


Do you have more than one perl on this system?  Maybe XAMPP installs a
separate one.


Yes, XAMPP has its own Perl, but I ensure I install packages using 
'/opt/lampp/bin/perl -MCPAN -e shell'.


I'm pretty sure the XAMPP Apache server is using its own Perl rather 
than the default /usr/bin/perl as I have a large number of dependencies 
for my mod_perl web apps which do not exist under the default perl lib 
path.


'which perl' points to /usr/local/bin/perl which is an alias to the 
XAMPP /opt/lampp/bin/perl, and 'perl -V' points to the 
/opt/lampp/lib/perl5 libraries.


But still, maybe some conflict between the two Perls?
--
Richard Jones


Re: Problem with perl-status memory usage

2007-09-12 Thread Perrin Harkins
On 9/12/07, Richard Jones <[EMAIL PROTECTED]> wrote:
> I'm pretty sure the XAMPP Apache server is using its own Perl rather
> than the default /usr/bin/perl as I have a large number of dependencies
> for my mod_perl web apps which do not exist under the default perl lib
> path.

Check it by finding the directory your Devel::Sympdump is in and
seeing if it's in your mod_perl server's @INC.

- Perrin


Re: Problem with perl-status memory usage

2007-09-12 Thread Richard Jones

Perrin Harkins wrote:

On 9/12/07, Richard Jones <[EMAIL PROTECTED]> wrote:

I'm pretty sure the XAMPP Apache server is using its own Perl rather
than the default /usr/bin/perl as I have a large number of dependencies
for my mod_perl web apps which do not exist under the default perl lib
path.


Check it by finding the directory your Devel::Sympdump is in and
seeing if it's in your mod_perl server's @INC.


find / -name Symdump.pm:
/opt/lampp/lib/perl5/site_perl/5.8.7/Devel/Symdump.pm

/opt/lampp/bin/perl -e 'print join "\n", @INC':
/opt/lampp/lib/perl5/site_perl/5.8.7 (+ others under /opt/lampp)

But can I be absolutely sure the XAMPP mod_perl server *is* using the 
libraries under /opt/lampp/lib? I think so because 
$ENV{SERVER_SIGNATURE} from a printenv script lists Perl/v5.8.7, which 
is the version of Perl bundled with XAMPP, whereas the default Mandrake 
install is v5.8.5.

--
Richard Jones


Re: Memory usage

2007-09-12 Thread Raymond Wan

Michael Peters wrote:

Any links or discussion would be great.



You really need to benchmark it for yourself using the version you are
targetting and the OS. You can do it outside of apache and just have a simple
Perl script that does nothing but sleep after it's created the large data
structure you want. Then use something like top (or whatever the best tool on
your OS is) to see how much memory it takes us.

  


I'm not sure if the numbers reported are accurate, but if Unix/Linux is 
used, then you can run the program under "valgrind" or the Unix "time" 
command (with appropriate flags).


I don't know the details of perl, but I have written various data 
structures such as hashes in Perl and then C and the C version takes a 
lot less memory.  I'm sure there is overhead because the perl script is 
interpreted, but there is probably a lot more going on.  If you want to 
see how much memory the data structure (alone) is using, perhaps you 
(Will) can write two versions of the script...one with and one without 
the data structure...take the difference, as reported by valgrind, time, 
or top and you'll get the space used by the data structure.


Ray