|
Michael A Chase |
at Dec 18, 2002 at 5:53 pm
|
⇧ |
| |
On Wed, 18 Dec 2002 11:08:14 -0600 "Zhou, Bixia" wrote:
We are currently using: perl, v5.8.0 built for MSWin32-x86-multi-thread
The test code as following:
my $process = 1;
while ($process){
my $dbh = DBI->connect('dbi:Oracle:sid', $user, $pass, { AutoCommit =>
});
if ($dbh =~ /ERR/)
{
exit;
}
$dbh->disconnect;
undef $dbh;
sleep(10);
}
The memory usage starts at 9mb and keeps up. Anybody notices this before?
and has a solution?
I don't see how this will ever exit since $dbh is a blessed database
handle, not a string.
Try declaring $dbh before you start the loop instead of creating a fresh
copy every time through the loop.
my $process = 1;
my $dbh;
while ( $process ) {
$dbh = DBI -> connect( "dbi:Oracle:$inst", $user, $pass,
{ AutoCommit => 0 } )
or die "Connect to $inst as $user failed: $DBI::errstr";
$dbh -> disconnect;
undef $dbh;
sleep(10);
}