RE: Purify, Perl and mod_perl
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
Re: Purify, Perl and mod_perl
Perrin Harkins wrote: [...] >> 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. or cannot free it because of the closure or a circular reference, which seems to be the case with the bug in Apache::Request reported by Dave Rolsky. [...] > 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 > Plus Apache::Leak, whose reports should be carefully analyzed because not everything that it reports as a leak is actually a leak: http://perl.apache.org/docs/1.0/guide/debug.html#How_can_I_find_out_if_a_mod_perl_code_has_a_memory_leak __ Stas BekmanJAm_pH --> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
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
Purify, Perl and mod_perl
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