Mailing List
Home
Forum Home
MySQL General - General MySQL discussion
MySQL++ - Programming with the C++ API to MySQL
MaxDB - Everything about MaxDB, formerly known as SAP DB
ODBC - ODBC with the MySQL Connector/ODBC driver
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
Java Help - Mostly related to the MySQL Connector/J driver
Perl - Perl support for MySQL with DBI and DBD::mysql
GUI - MySQL GUI Tools
Announcement
Subjects
mysql openssl Question
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
Update one field with more fields from another table
Getting Identity after INSERT
ERROR 2002: Can 't connect to local MySQL server through socket
mysql test 4 1 fails with the gis test
MySQL Cluster Software
Downgrade Mysql from 4 to 3 23
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Can 't access mysql after kernel upgrade
Executing MySQL Commands From Within C Program
Comparing and writing out BLOBS
Preventing Duplicate Entries
FULLTEXT query format question
Strange behavior, Table Level Permission
Does the binary log enabling affect the MySQL performances?
mysql:it 's a db not a dbms how it 's possible?!
mysql have same function mthod as Oracle decode()
 
Memory leak on continuous connect failures

Memory leak on continuous connect failures

2006-08-15       - By julian.griffiths@(protected)

 Back
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