Here is the sample code :
use strict; my $base_loc = "/base/location"; my @results = ( 'QFU010508.865714.tar.gz' , 'AAL_AGG.738208.tar.gz' , 'QFU010508.870496.tar.gz' , 'QFU010508.870512.tar.gz' , 'QFU010508.1017611.tar.gz' , 'QFU010508.1018350.tar.gz' , 'QFU020508.784543.tar.gz' , 'QFU020508.735377.tar.gz' , 'QFU020508.784632.tar.gz' , 'QFU020508.784637.tar.gz' , 'QFU020508.784641.tar.gz' , 'QFU020508.869793.tar.gz' ); foreach my $tar_file ( @results ) { my $path_to_file = $base_loc . "/" . $tar_file; my $extracts = Archive::Tar->new( $path_to_file ); print "Goin to sleep...\n"; sleep(5); if( !defined $extracts ) { print "INFO: Could not find : $tar_file file or Archive is not + valid\n"; } else { print "INFO: Processed $tar_file file\n"; } #Destroy the object undef $extracts; print "Object should get destroyed now, sleeping again.\n"; sleep(5); }
During running the above code, we can see that the memory consumption keeps on increasing ( using top ) even after object gets destroyed.

In reply to Re^2: Archive::Tar Memory deallocation problem by bgupta
in thread Archive::Tar Memory deallocation problem by bgupta

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.