I'd suggest that you add a line: print 'Done'; <STDIN>; just before the end of the program. When the prompt appears, pop up he task manager (or better, Process Explorer if you have it), and monitor the memory usage at that point. Then, leaving the manager window visible, hit enter on the command session and watch what happens.

Personally, I've never seen the situation where 'out of memory' occurred during clean up, but that doesn't mean it couldn't happen.

But the thing that is baffling me is why you are still running out of memory now you've reduced the memory usage? Perhaps now would be a good time to post the latest version of your code and see if other people (me) can reproduce your findings.

Remember to include the initial input file--or sufficient information to allow us to accurately mock it up--so that we can run the code in a realistic fashion.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re^9: Handling HUGE amounts of data by BrowserUk
in thread Handling HUGE amounts of data by Dandello

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.