Subject: | Memory leak in DBD::Pg-1.43 |
The following code illustrates a memory leak that appears when
a prepared statement is repeatedly executed with defined and undefined parameters.
use strict;
use DBI;
my $dbh = DBI->connect("dbi:Pg:dbname=template1", (($^O =~ /linux/) ? "postgres" : "pgsql"), '');
die "DBI->connect: $DBI::errstr" unless $dbh;
my $sth = $dbh-> prepare( "SELECT ?::text;");
while ( 1) {
$sth-> execute( '1' x 100_000);
$sth-> fetchrow_arrayref;
$sth-> execute(undef);
$sth-> fetchrow_arrayref;
}