Purify, Perl and mod_perl

2002-07-16 Thread Carwheel, Dan

I've looked at Rational's Purify:

http://www.rational.com/products/purify_unix/index.jsp, 

and although their web page says only works for C, C++, Java and a few
others, I've seen this page:

http://www.perlpod.com/stable/perlhack.html 

on getting Perl work with with Purify.

My question is this...can I run my application using this purified perl
under mod_perl to track down potential memory leaks and other problems? Are
there any issues with running Perl for testing with Purify on a mod_perl
enabled webserver? 

Thanks for the advice.

--Dan



RE: Purify, Perl and mod_perl

2002-07-16 Thread Carwheel, Dan

I understand.  But, given a new 'purified' perl binary I could build using
Purify, would it allow me to diagnose or trace memory leaks back to my Perl
code? I'm asking from a theoretical basis here, since I agree with you, I
doubt I have any memory leaks. 

Thanks.
--Dan

-Original Message-
From: Perrin Harkins [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 16, 2002 11:09 AM
To: Carwheel, Dan
Cc: '[EMAIL PROTECTED]'
Subject: Re: Purify, Perl and mod_perl


Carwheel, Dan wrote:
 although their web page says only works for C, C++, Java and a few
 others, I've seen this page:
 
   http://www.perlpod.com/stable/perlhack.html 
 
 on getting Perl work with with Purify.

That page is about getting Perl's C executable to work with Purify, not 
using Purify to check your perl code.

 My question is this...can I run my application using this purified perl
 under mod_perl to track down potential memory leaks and other problems?

You probably don't have any memory leaks.  Most things that people refer 
to as leaks are just normal growth.  A leak is when an area of memory 
gets lost because the program that allocated it forgets to free it. 
Growth is when your program uses variables in such a way that it needs 
more memory over time.  The latter is pretty common.  Doing things like 
eval'ing code, reading variable length data into strings, and keeping 
other data structures that are affected by changes in user input or data 
over time will often lead to this.

If you have out-of-control memory growth, you should try finding it the 
old-fashioned way: take things out until it stops.  Then, if you find a 
little section that causes growth and you can't understand why, post it 
here and someone may be able to explain it.

A number of the most common sources of memory growth are explained in 
the guide: 
http://perl.apache.org/docs/1.0/guide/performance.html#Improving_Performance
_by_Prevention

- Perrin