I played with this a bit, and it looks like DBD::CSV is what is leaking. The below code leeks ~32K/iteration, and I think the leek is originating from the execute() of a statement that has a WERE clause.
If I drop the size of the where, clause it does not leak as much memory (removing it completely cause nothing to leak), and moving the connect & prepare out of the while(1) loop do not seem to do anything.
What version of SQL Statement do you have? I just tried upgrading to the latest version and that fixed the problem (But the new version is much slower, alas.)
$|++; use strict; use DBI; while(1) { my $dbh = DBI->connect("DBI:CSV:f_dir=./") or die "Cannot connect: " . $DBI::errstr; my $bob = $dbh->prepare("select * from foo where 1 = 1 OR 1=1 or 1=2 or 5.6=6 or 7=7 or 9=10 or 11=23 or 6=6 or 7=7 or 9=10 or 11=23 or 6=6 or 7=7 or 9=10 or 11=23 or 1 = 1 OR 1=1 or 1=2 or 5.6=6 or 7=7 or 9=10 or 11=23 or 6=6 or 7=7 or 9=10 or 11=23 or 6=6 or 7=7 or 9=10 or 11=23 or 1 = 1 OR 1=1 o +r 1=2 or 5.6=6 or 7=7 or 9=10 or 11=23 or 6=6 or 7=7 or 9=10 or 11=23 or 6=6 or 7=7 or 9=10 or 11=23 or 1 = 1 OR 1=1 or 1=2 o +r 5.6=6 or 7=7 or 9=10 or 11=23 or 6=6 or 7=7 or 9=10 or 11=23 o +r 6=6 or 7=7 or 9=10 or 11=23 or 1 = 1 OR 1=1 or 1=2 or 5.6=6 o +r 7=7 or 9=10 or 11=23 or 6=6 or 7=7 or 9=10 or 11=23 or 6=6 or 7=7 or 9=10 or 11=23 "); $bob->execute(); $bob->finish; print "."; sleep(1); }
In reply to Re: DBD::CSV Memory Leak
by tantarbobus
in thread DBD::CSV Memory Leak
by AcidHawk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |