I think you're probably noticing the cost of global destruction. At the very end of the program's execution, the interpreter will go through every single allocation and see if it needs to be DESTROYed. See perlobj, especially the bit at the end.
I don't think you can switch this off. If anything, you can only make it worse :) A perl binary built with -DDEBUGGING will let you set the PERL_DESTRUCT_LEVEL to increasing values, which will exercise the garbage collector more and more severely. This is used to smoke out problems involving memory leaks.
One avenue worth exploring is whether in fact you are leaking a colossal amount of memory during the program's execution, thus leaving 5.4Gb to be cleaned up at the end. Remove the leak, and maybe global destruction will become much cheaper.
• another intruder with the mooring in the heart of the Perl
Are you posting in the right place? Check out Where do I post X? to know for sure.
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
Want more info? How to link or
or How to display code and escape characters
are good places to start.