Hello harangzsolt33,

from the little I know it is very rare that memory is actually released to the OS. I think that some memory can be reused by your perl program but I suspect it will not be released (maybe this depends on the OS?).

Waiting for other more expert answers you can consider to use a memory profiling program to test out your assumption: Devel::SizeMe and Devel::Size seems to be appriopriate choices.

You can also consider to not load at all the file in memory: File::Map does exactly this. See memory-map-files-instead-of-slurping-them.

L*

PS please add some <code> tags around your code

PPS see also Mini-Tutorial: Perl's Memory Management which suprised me with the sentence: You are more likely to see memory being released to the OS on Windows

PPPS Perl and Garbage Collection linking to Do subroutine variables get destroyed?

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

In reply to Re: Memory efficient design by Discipulus
in thread Memory efficient design by harangzsolt33

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.