Subject: | eat memory |
Hello Jeff,
We was talked about that on perlmonks, but perhaps you don't understand
me, anyway the problem exists when persist the use in time, in my
particular case i'm use an script that works around of 24-48hs, but
after some minutes, the OS acuse low memory, when I check with the
control panel, it's take around of 1.5Gb of memory |-), the database has
only 1mb, and around of 10000 rows.
Well this's all, below is the original post for more reference.
I'm using DBI v1.601, yours SQL::Statement v1.15, DBD::CSV v0.22 and
Text::CSV_XS v0.30.
Try something like this and you see:
#!/usr/bin/perl
use DBI;
unless (-e './list') {
open F, '>','./list';
print F "id\n";
for (0..1000000) {
print F $_.('z' x 10)."\n";
}
close F;
}
our $st = DBI->connect('DBI:CSV:f_dir=.',{RaiseError=> 1});
my $check = $st->prepare(q{
SELECT COUNT(*) FROM list
WHERE id=? LIMIT 1
});
my $a = 0;
while ($a++ < 1000000) {
$check->execute($a.('z' x 10));
print $a.('z' x 10)."\n";
}
$check->finish();
$st->disconnect();
PD: the original post http://www.perlmonks.org/?node_id=651110