Re: Memory leak in perl-DBD-Mysql

"Yen-Ming Lee" <[email protected]>
Newsgroups gmane.comp.db.mysql.perl
Message-ID <006101c49a41$0a10a030$c901a8c0@LEEYMNB>
(Hmm, Reposting:
http://ilist.yahoo.com/wws/arc/devel-perl/2004-08/msg00016.html)

It's a known bug about memory leak in bind_param() introduced in DBD::mysql
2.9002, and was fixed in 2.9003.
http://search.cpan.org/src/RUDY/DBD-mysql-2.9004/ChangeLog

Is it possible to upgrade ypan/perl-DBD-mysql to version 2.9003 or above
(the latest release is 2.9004)?
--
Yen-Ming Lee [utf7:+Z05fZWYO], E-Commerce Software Engineer, Yahoo! Taiwan



----- Original Message ----- 
From: "Arvind J" <[email protected]>
To: <[email protected]>; <[email protected]>
Sent: Tuesday, September 14, 2004 2:37 AM
Subject: Re: Memory leak in perl-DBD-Mysql


> On Mon, Sep 13, 2004 at 11:12:42AM -0700, Jeremy Zawodny wrote:
> >On Mon, Sep 13, 2004 at 11:37:52PM +0530, Arvind J wrote:
> >> Hi folks,
> >>   The latest perl-DBD-mysql has a memory leak that can be observed when
doing
> >> a large number of "INSERT" statements (may also be present for a small
number)
> >>   The leak is pretty linear and a function of the query string. I'm not
sure
> >> at what point this bug was introduced but I can say that version 2.1026
does
> >> not have it and version 2.9002 does have it. 2.9002 btw is the "stable"
> >> version on ypan. This prob was discussed in devel-perl and devel-db a
few
> >> months ago but had to be rediscovered the hard way.
> >>   So keep a close eye when installing/upgrading this module.
> >
> >Can you produce a test case, please?
> >
> >Is it as simple as running the same INSERT IGNORE over and over?  Or
> >must the queries actually accomplish soething?  Must the queries vary?
> >Are you using prepared statements?
>
> I prepare the statment once and execute many times (in order of millions).
> All inserts do accomplish something in my tests, never tried the other
way.
>
> Here's the main segments of the code
>
>
> my $ins_sth = $dbh->prepare("insert into SymbolHistory (SymbolID, Date,
Open, High, Low, Close, Volume)".
>    " values (?, ?, ?, ?, ?, ?, ?)");
> my $map_sth = $dbh->prepare("select ID from Tk2Reuters where Symbol=? and
Exchg=?");
>
> while(my $line = <FL>)
> {
>   .........
>
>   $map_sth->execute($ticker, $mkt);
>   while(my $hash = $map_sth->fetchrow_hashref())
>   {
>     $ID = $hash->{'ID'};
>   }
>
>   .........
>   foreach (.................)
>   {
>     $ins_sth->execute($ID, $dates[$i], $open, $high, $low, $close, $vol);
>   }
> }
>
>
> Arvind
>
> >-- 
> >Jeremy D. Zawodny, <[email protected]>
> >Technical Yahoo - Yahoo MySQL Geek
> >Desk: (408) 349-7878  Cell: (408) 685-5936
> >
>
>


-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.