Memory leak on continuous connect failures

<[email protected]>
Newsgroups gmane.comp.db.mysql.perl
Message-ID <1CEB5E05B0ED3F449974E30864651F2B37E6C4@E03MVX4-UKDY.domain1.systemhost.net>
Hi
I am seeing a potential memory leak with DBD::mysql, when I continuously
fail to connect to the database.  I see similar results on both UNIX
(Solaris 8) and on Win32 (Active Perl)

My test script is:
#!/usr/local/bin/perl -w

use strict;
use DBI;
use DBD::mysql; # So that I can determine mysql VERSION

my $dbh;
my $DB_HOST     = "aaa";
my $EV_DB       = "bbb";
my $User        = "ccc";
my $Passwd      = "ddd";

print "DBI Version: ",$DBI::VERSION,"\n";
print "DBD Version: ",$DBD::mysql::VERSION,"\n";


do {
        $dbh = DBI->connect("DBI:mysql:$EV_DB:$DB_HOST;",$User,
$Passwd,{PrintError => 0});
        if (!$dbh) {
                print STDERR "Connect Failed: ",$DBI::errstr, "\n";
        }
}while (!$dbh);

print "Connection Successful\n";

This results in about 8kb increase per 3 seconds in both the RSS and VSZ
of the process for UNIX
And significantly more on Win32.

$ while (true) do^Jps -eo "pid ppid rss vsz pmem args" | grep
[t]est_connect^Jsleep 3^Jdone
11775 11427 5216 6592  1.1 /usr/local/bin/perl -w ./test_connect.pl
11775 11427 5224 6600  1.1 /usr/local/bin/perl -w ./test_connect.pl
11775 11427 5232 6608  1.1 /usr/local/bin/perl -w ./test_connect.pl
11775 11427 5232 6608  1.1 /usr/local/bin/perl -w ./test_connect.pl
11775 11427 5240 6616  1.1 /usr/local/bin/perl -w ./test_connect.pl
11775 11427 5248 6624  1.1 /usr/local/bin/perl -w ./test_connect.pl
11775 11427 5256 6632  1.1 /usr/local/bin/perl -w ./test_connect.pl

The versions that I am using are:
UNIX DBI: 1.51
	DBD:mysql:	3.006
WIN32 DBI: 1.34
	DBD::mysql:	3.006


Cheers Julian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.