Good thought but I tried that. This backup process started life as a batch file. I rewrote it using Perl in Dec so that I could add better logging and an email notification at the end.

The .exe I am using is gwback32.exe. It was a download from Novell.

Watching the stats during the process should prove "exciting". I have been running a full backup for the past 3.5 hours and it is still working on step 1 of 3. Over that time the PF Usage has risen steadily from 250 to 362.

Here's a thought: Suppose the leak is in gwback.exe. As I understand it a system() command from perl does a fork to run the command. Once that spawned process ends, are the resources that were leaked during that child process released? What about in a batch file rather than a perl script? That may account for why the .bat works and the perl does not.

Here is the trimmed code. As mentioned it is pretty simple:

#!/usr/local/bin/perl use strict; use warnings; use Date::Calc qw( Today_and_Now ); use MIME::Lite; #print "** start **\n"; my ( $cmd ) = ( '' ); my $pofront = 'C:\gwbackup\gwback32.exe '; append_log ( "\n--- Begin Nightly Backup ---", 0); $cmd = $pofront . '/po-\\\\Usacscpost52\POVOL\cscpos52 /backup-e:\cscp +os52 /silent'; do_cmd_and_log( $cmd, "Copy cscpos52" ); $cmd = $pofront . '/po-\\\\Usashacmail\SYS\SHACPOST /backup-e:\shacpos +t /silent'; do_cmd_and_log( $cmd, "Copy shacpost" ); $cmd = $pofront . '/po-\\\\Usamcpost\sys\umcpost /backup-e:\umcpost /s +ilent'; do_cmd_and_log( $cmd, "Copy umcpost" ); append_log( "End Backup", 1 ); #send_complete_msg(); #print "** done **\n\n"; exit; sub append_log { my ( $txt, $dotime ) = @_; if ( $dotime ) { my @now = Today_and_Now(); $now[3] = "0$now[3]" if ($now[3] =~ /^\d{1}$/); $now[4] = "0$now[4]" if ($now[4] =~ /^\d{1}$/); $txt = " $now[1]/$now[2]/$now[0] $now[3]:$now[4] $txt"; } open( OUTFILE, '>>C:\gwbackup\gwback.log'); my $old_handle = select(OUTFILE); print "$txt\n"; close OUTFILE; select($old_handle); } # append_log sub do_cmd_and_log { my ( $cmd, $txt ) = @_; append_log( "Begin $txt", 1 ); system($cmd); } # do_cmd_and_log

In reply to Re^2: Activeperl & Memory Leaks by Possumfoot
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.