Subject: | 3.0004: memory leak with server-side prepares, MySQL 4.1.14, RHEL3, Perl 5.8.4 |
Date: | Tue, 30 May 2006 14:11:49 -0700 |
To: | <bug-DBD-mysql [...] rt.cpan.org> |
From: | "Jason Snell" <jsnell [...] cloudmark.com> |
First, here are the perl/mysql versions involved:
MySQL: 4.1.14
Perl: 5.8.0
DBI: 1.50
DBD::mysql: 3.0004
Here is a simple perl script that uses server side prepares (db vars
removed):
#!/usr/bin/perl -w
use strict;
use DBI;
my $ssp = 1;
my $count = 0;
my $query = "SELECT 1 FROM DUAL";
my $dbh = DBI->connect (
"dbi:mysql:database=$DBName:host=$DBHost:mysql_server_prepare=$ssp",
$DBUser, $DBPass,
{ RaiseError => 1, PrintError => 0 },
);
my $s_q = $dbh->prepare($query);
while (1) {
$s_q->execute();
my @data = $s_q->fetchrow_array();
$s_q->finish;
$count++;
print "ran $count queries\r";
sleep(0.3);
}
This script, when run, will eat about 10M of memory a second. Am I
missing something about server side prepares?
Cheers,
-Jason