You probably don't have a "leak" in the traditional C programing sense. More likely, you have some lexical variables that you're putting large amounts of data into. Lexicals do go out of scope, but Perl holds onto their memory as an optimization in case they need it again. This means that if you stuff 32K into a lexical, it will stay 32K (actually even bigger) for the life of your program.
One thing you can try is an explicit undef on any lexicals holding large amounts of data. This is supposed to release the memory back to the general pool for Perl (although not back to the OS on most systems). Also, make sure you are using references whenever passing around large chunks of data to subroutines.
You may be having problems because of your DBD driver. I've seen some versions of DBD::Oracle exhibit bad behavior in terms of memory, mostly due to the constantly changing OCI libraries they depend on. You might want to try stripping out the DBI stuff (or replacing it with dummy calls) and seeing if that makes your memory problem go away. There are configuration parameters you can tweak if this is the problem.
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.