on 2002-12-18 11:56:08-06, Michael A Chase <[EMAIL PROTECTED]> wrote:
>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);
> }
>

Perl 5.8 is known to have memory leaks related to the "stdio" layer.
In UNIX, a workaround is to set the environment variable PERLIO
to have the value "perlio" before invoking perl.  This may or
may not be related to your problem.  In UNIX (using bash) the
solution is to have an "export PERLIO=perlio" command before 
invoking perl.

HTH,
Bill B.

Reply via email to