Re: Identifying memory leaks

2002-11-27 Thread Huili_Liu

check Apache::leak that will help you to track mod_perl memory leak.

Willy



   
 
  Charles
 
  frankeldsl@peakpTo:   [EMAIL PROTECTED]  
 
  eak.com cc: 
 
   Subject:  Identifying memory leaks  
 
  11/26/2002 02:28 
 
  PM   
 
   
 
   
 





A Linux machine running Apache/2.0.35 (Unix) mod_perl/1.99_05-dev
Perl/v5.6.1 mysql 4.0.1 uses increasing used memory (according
/usr/bin/free), eventually resuting in all memory being consumed.  Memory
usage drops somewhat after a reboot of apache and mysql, but not
completely.

If a reference does not go out of scope between sessions, that memory will
not be garbage collected.  I would like to test for these types of
difficulties.

Questions:

Are there tools to track total (all threads/processes) mod_perl, apache,
mysql memory usage?

What is the normal behavior for a module which connects (via a global) to a
database in terms of mysql processes started?









Identifying memory leaks

2002-11-26 Thread Charles

A Linux machine running Apache/2.0.35 (Unix) mod_perl/1.99_05-dev
Perl/v5.6.1 mysql 4.0.1 uses increasing used memory (according
/usr/bin/free), eventually resuting in all memory being consumed.  Memory
usage drops somewhat after a reboot of apache and mysql, but not completely.

If a reference does not go out of scope between sessions, that memory will
not be garbage collected.  I would like to test for these types of
difficulties.

Questions:

Are there tools to track total (all threads/processes) mod_perl, apache,
mysql memory usage?

What is the normal behavior for a module which connects (via a global) to a
database in terms of mysql processes started?





Re: Identifying memory leaks

2002-11-26 Thread Stas Bekman
Charles wrote:

A Linux machine running Apache/2.0.35 (Unix) mod_perl/1.99_05-dev
Perl/v5.6.1 mysql 4.0.1 uses increasing used memory (according
/usr/bin/free), eventually resuting in all memory being consumed.  Memory
usage drops somewhat after a reboot of apache and mysql, but not completely.


Well, why it's possible. I doubt it does. Most likely your code causes 
the leakage.

First of all, if you don't report the complete details about your build 
we can't even start helping to you. Use the proper procedure of 
reporting problem as described here:
http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems
(linked from the shortcuts menu on the left of perl.apache.org so it's 
*easy* to find)

Second, do you see the same behavior under mod_perl 1.0?

If a reference does not go out of scope between sessions, that memory will
not be garbage collected.  I would like to test for these types of
difficulties.


First of all you should try and isolate the problem, so your test case 
is simple. Debugging a huge program can be a problem. The mod_perl guide 
discusses several ways to debug problems, though not all tools are 
available to 2.0 yet, so you better off debugging this with mod_perl 1.0 
 if possible. For example see:
http://perl.apache.org/docs/1.0/guide/debug.html#How_can_I_find_out_if_a_mod_perl_code_has_a_memory_leak

Questions:

Are there tools to track total (all threads/processes) mod_perl, apache,
mysql memory usage?


Apache::VMonitor for mod_perl 1.0 should be of a good help. I've several 
obstacles that I'm trying to resolve at the httpd land and then I'll 
make it available for 2.0.

What is the normal behavior for a module which connects (via a global) to a
database in terms of mysql processes started?


it's also possible that the way your wrote the code brings huge chunks 
of data from db into the memory and never frees them. (e.g. a closure 
problem 
http://perl.apache.org/docs/general/perl_reference/perl_reference.html).

in summary, narrow down the test case if possible, hopefully without 
involving any rdbms code, send the complete details of your setup and we 
will see what can be done.

__
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