I have been testing and troubleshooting this for days, and I can find no
other answer to my problem except that DBD::mysql has a memory leak.

I have narrowed it down to this small script running through
Apache::Registry:

------------------------------------------------------------
use DBI;
use DBD::mysql;
use strict;

print "Content-type: text/plain\n\n";

my $dbh = DBI->connect("dbi:mysql:db;host=localhost", "user", "pass")
   or die "no DB!\n";

my $sth = $dbh->prepare(q{
   select * from junk where id = 10
});

$sth->execute() or die "no sql\n";
while (my @row = $sth->fetchrow_array())
{
   print join("\n", @row), "\n";
}

$sth->finish;
$dbh->disconnect;
------------------------------------------------------------

This script runs just fine, and displays the contents of the single
specified MySQL row.  However, if I watch the size of my httpd process, it
will grow over time as I access the script repeatedly.

I use the following script to load test it:

------------------------------------------------------------
use LWP::Simple `get`; 
 
$uri = shift; 
$hits = 0; 
 
$SIG{INT} = sub { print "fetched: $hits"; exit }; 
 
while(1) { 
    get $uri or die "get failed!"; 
    $hits++; 
} 
------------------------------------------------------------

I am using the latest DBD::mysql module, as far as I can tell.  I forced a
reinstall with CPAN shell, just to be sure.  Here is my version info:

Msql-Mysql-modules-1.2215
Embedded Perl version v5.6.0 for Apache/1.3.12 (Unix) mod_perl/1.24

As common as this mod_perl/DBD/MySQL combination is, SOMEBODY else has to
have had this same trouble and solved it.  Right? ... Right?

Thanks,

Mark Blythe
[EMAIL PROTECTED]

P.S.  I've used Apache::Leak and Apache::Status to no avail.


Reply via email to