If your memory is less, there are a few possibilities:

a) your program uses a GUI. X11 might allocate memory for your program which it isn't giving back

b) your program doesn't really exit. Check your system for defunct processes

c) some OS caches might fill up memory. Did you for example access the file system with your script?

d) your OS or some other process interacting with your script might have a memory leak

You might save the output of 'ps -elf' to some file between a few starts of your script and see if you can spot any differences in the memory footprint of the processes. If not, either the differences are too small or your OS is using up the memory.


In reply to Re^3: Memory and garbage collection by jethro
in thread Memory and garbage collection by Anonymous Monk

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.