Well, taking out the no_chdir option would probably make it run faster and use less memory. But I'd be more suspicious of Win32::Perms having a leak than File::Find, mostly just because Win32::Perms has tons of "Perl written in C code" and that is notorious for being complicated enough that the author doesn't get the reference counts correct, even if the author of this module is rather highly regarded.

So you have two experiments you can run immediately. Run the script as-is again and watch its memory consumption (running any Perl script on a system with little virtual memory if probably not a good idea, BTW) long enough to figure out about how fast it grows. Then kill it and rerun it with no_chdir turned off and then with the use of Win32::Perms commented out. Compare the rate at which memory consumption grows.

BTW, you want to look at the growth of VM usage and most tools will prefer to show you "working set size". For example, if using Windows Task Manager (taskmgr), then select View then Select Columns... then check Virtual Memory Size.

        - tye (but my friends call me "Tye")

In reply to (tye)Re: Virtual memory issue with File::Find? by tye
in thread Virtual memory issue with File::Find? by OzzyOsbourne

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.