I believe this is not related to Class::DBI but rather your version of perl. I get memory leaks with ActivePerl 5.6.1 (Build 633 on win2k -- about 2k per second). However, with ActivePerl 5.8.0 Build 804, I get no such leaks. BTW, I used Class::DBI::SQlite for testing purposes(not that it would make any difference). I'm sure if you look around you'll stumble on mention of this bug (i hope -- i vaguely recall tye(or t?) mentioning a bug related to the for loop not freeing lexicals -- this is probably the same thing).

update: I messed around a little with Devel::Leak (adding the relevant bits around the for-loop, and changing the number of iterations to 1000)

5.6.1 => BEFORE(30692) AFTER(30808) => 116
5.8.0 => BEFORE(29653) AFTER(31774) => 2121
So the loop creates approximately 2005 more scalars in perl 5.6.1, which does seem to confirm the memory leak theory.

update: nice followup -- it's too easy to make memory leaks in perl and XS -- i'll give it a closer look later (examine my DBI/DBD-SQLite versions and so on).

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.


In reply to Re: Class::DBI and create: program memory just grows and grows by PodMaster
in thread Class::DBI and create: program memory just grows and grows by shenme

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.