Hi.

I'm running 1.52 and I may have found a leak ( i found a discussion reported on the 1.51 branch, and a patch to 1.52, so i think this might be different )

I was profiling some mod_perl code for unexplained growth with Devel::Leak, and came across a growth of 1 reference count with every call to $dbh->prepare ( also to $dbh->do , but it seems to just wrap prepare ).

the growth seems to happen regardless of parameters supplied to do / prepare

my      $handle;
my      $count= Devel::Leak::NoteSV($handle);
=snip
        my      $query= $dbh->prepare( 'SELECT id FROM my_table' );
=snip
print STDERR "\n Count before: " . $count;
print STDERR "\n ------------------------------------------";
my      $count_after= Devel::Leak::CheckSV($handle);
print STDERR "\n Count after: " . $count_after;
print STDERR "\n Leaked: " . ( $count_after - $count );

If i comment out the do/prepares, I have no leaks in reference counts.

Now , i'm using DBD::Pg with this, and it very well could be an issue with that driver and not the DBI. unfortunately, I can't install any other DB on my machines to test.

I haven't been able to trace things within DBI , as I'm not that familiar with it.

Off a fresh apache start, a call to the DBD prepare will cause a growth of ~10 references, then ~5, and then 1 per request. Between this and some other things online, I kind of think that it might have to do with DBI's caching of the statement. I couldn't find that in the code though.

Reply via email to