On Wed, Mar 05, 2003 at 08:13:00AM -0600, Philip Molter wrote: > I have a very long running Perl process. I recently upgraded the > DBI from 1.32 to 1.33 (and then 1.34) and now, the process is leaking > memory. Given the complexity of the project, it's not possible to > reduce it to a simple test case at this time, but it's definitely > related to the DBI -- if I downgrade to 1.32, the problem goes away.
The leak is in fetchrow_hashref, after the change to workaround a Taint problem in some versions of perl. Here's a patch (probably offset by a few lines, but close enough). I'll make a new release soonish. Thanks for spotting this. (If I have time I'll try to integrate a leak test into the test suite.) Tim. *************** *** 3562,3568 **** } RETVAL = newRV((SV*)hv); SvREFCNT_dec(hv); /* since newRV incremented it */ - SvREFCNT_dec(ka_rv); /* since we created it */ } else { RETVAL = &sv_undef; --- 3564,3569 ---- *************** *** 3570,3575 **** --- 3571,3577 ---- RETVAL = newSV(0); /* mutable undef for 5.004_04 */ #endif } + SvREFCNT_dec(ka_rv); /* since we created it */ OUTPUT: RETVAL