Don't forget that garbage collection makes memory available for re-use by the program, but does not (generally) release memory to the operating system.

Releasing memory to the OS is a complicated matter that most applications/languages/frameworks do not attempt, and is not possible on many OSes.

In any case, if you have a long-running program that uses and releases memory objects, it would be a pointless expense to release memory to the OS, since you will later allocate new objects, which requires requesting more memory. Only in the case of requiring large amounts of memory during an early stage, followed by a lengthy low-memory-requirement phase, would it make sense. I suppose in such a case you could fork a separate process with the heavy memory requirements, so that it will terminate and release memory, after sending the required data to the main process.

--
TTTATCGGTCGTTATATAGATGTTTGCA


In reply to Re: Gregorian Garbage Collection... by TomDLux
in thread Gregorian Garbage Collection... by edwar64896

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.