Memory Leak in DBI 1.54 and DBD::ODBC?
by Adam R. Frielink other posts by this author
Mar 16 2007 11:20AM messages near this date
RE: Anyone still monitor?
|
RE: Memory Leak in DBI 1.54 and DBD::ODBC?
Below is a sample script I run that causes a memory leak on Windows 2003
SP1 Servers. I lose around 4k of memory every minute this script runs,
I apologize for not being able to give a more accurate number. Any
ideas?
We were using DBI 1.49, and read that some memory leaks were fixe in
1.52, so we upgraded to the current versions of DBD::ODBC and DBI as
found on Acitvestate repositories yesterday.
#!/usr/bin/perl -w
use DBI;
use DBD::ODBC;
my $delay = 0;
Poll($delay);
sub Poll{
my ($delay) = @_;
my $dbh = DBI-> connect("DBI:ODBC:DSN", 'USER', 'PASSWD') or die
"Cannot connect to Data Server: $DBI::errstr\n";
$dbh-> disconnect();
undef $dbh;
while(1) {
my $dbh = DBI-> connect("DBI:ODBC:DSN", 'USER', 'PASSWD') or warn
"Cannot connect to Data Server: $DBI::errstr\n";
if ($dbh) {
$dbh-> disconnect();
}
Win32::Sleep($delay); #apply wait time until next transaction
attempt.
undef $dbh;
}
}
_______________________________________________
Perl-Win32-Database mailing list
Perl-Win32-Database@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Adam R. Frielink
Adam R. Frielink
|