I suspect the memory leak is in the stand-alone .exe, not in Perl. (BTW, which .exe are you using?) To prove it, change your program to take the commands that system() had been running, and write the commands into a batch file. Either schedule the Perl job separately from the batchfile job, or run the batchfile by hand from a separate command-prompt window. If the batch file fails, then the leak must be in the commands that it ran. You can then add code to your Perl program to split the backup load into smaller chunks, so that you run a higher number of smaller backups (or get a bug-fix for your .exe).

It may also be helpful to watch the actual stats for memory usage during the run of the backup executable. These steps work on WinNT and Win2000; Win2003 is probably similar.

  1. Start the Windows Task Manager (Ctrl-Alt-Del), click the "Processes" tab.
  2. From the menu, do View->Select Columns, then enable columns PID, CPU Usage, CPU Time, Memory Usage, Virtual Memory Size, Paged Pool, and Non-paged Pool. Click OK.
  3. Click on the "NP Pool" column header, to sort by that column.
See also: Memory Leaks on WinNT

If all else fails, then trim down the program to the smallest version that still exhibits the problem, and post it as a follow-up to this thread.


In reply to Re: Activeperl & Memory Leaks by Util
in thread Activeperl & Memory Leaks by Possumfoot

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.