Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: DBD::CSV Memory Leak

by tantarbobus (Hermit)
on Aug 05, 2002 at 19:34 UTC ( [id://187791]=note: print w/replies, xml ) Need Help??


in reply to DBD::CSV Memory Leak

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); }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://187791]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-24 18:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found