On Wed, 18 Dec 2002 11:08:14 -0600 "Zhou, Bixia" <[EMAIL PROTECTED]> 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 =>
> 0
> });
>   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);
 }

-- 
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.


Reply via email to