<ahem>
Perl most certainly
does have real garbage collection. Reference counting is one of several GC techniques.
</ahem>
One of the shortcomings of reference counting as a memory management technique is the problem of circular references. If you manage to get a Perl data structure to point to itself, all elements will continue to have non-zero reference counts even if nobody else points to the data structure. The structure hangs around in memory until the program terminates.
There are two other likely causes of memory leaks in Perl programs. First, there are known memory leaks in some version of Perl with eval.
A second source of leaks are with modules that use XS modules, which are linked into the application at runtime. If C code in the XS module doesn't correctly clean up after itself, external resources (e.g., resources not visible directly to Perl) can leak. Tk uses XS. You might be running into a leak in whichever version you're using.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.