I'm working on a server that needs to dynamically load differing pieces of code for different tasks and types of data. The code for any given package is created by compiling legacy BASIC code into perl code (with Parse::RecDescent) in its own namespace based on the source BASIC file. Since I'm dealing with potentially thousands or tens of thousands of namespaces, memory usage would go through the roof if they all remained in memory together (only a handful need to be in memory together at any given time).

In the search for a possible solution to the problem, I came across Symbol::delete_package, which appears to blast the symbol table for a given package clean. My question is this: When I use Symbol::delete_package to destroy a package, I imagine that the memory previously used by the variables in the package is freed for reuse, but does the memory previously held by the code in the package get freed for reuse, or does it simply remove it from the symbol table and continue holding onto the memory?

In reply to Does Symbol::delete_package free memory used by subs? by Chester K

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.