$ perl -e'use Devel::LeakTrace::Fast; { my $x = []; }' leaked SV(0x0x814ec28) from -e line 1 leaked SV(0x0x814ed84) from -e line 1 $ perl -e'use Devel::LeakTrace::Fast; { my $x = []; 1; }' $ perl -e'use Devel::LeakTrace::Fast; { my $x = []; } 1;' $

I suspect the value to which the sassign (=) evaluates (the reference returned by []) is on the stack for some unknown reason. As show, it doesn't stay there if you add *anything* to the program. So not a leak. For example, the only difference in the above "leaking" and fine code is an op used to give line numbers to warnings.

$ diff -u \ > <( perl -MO=Concise,-exec -we'use Devel::LeakTrace::Fast; { my $x + = []; } ' 2>&1 ) \ > <( perl -MO=Concise,-exec -we'use Devel::LeakTrace::Fast; { my $x + = []; } 1' 2>&1 ) --- /dev/fd/63 2009-04-21 15:31:32.471371429 -0400 +++ /dev/fd/62 2009-04-21 15:31:32.475372857 -0400 @@ -9,4 +9,5 @@ 8 <0> padsv[$x:279,280] sRM*/LVINTRO 9 <2> sassign vKS/2 a <2> leaveloop vK/2 +b <;> nextstate(main 281 -e:1) v <-- only difference -b <@> leave[1 ref] vKP/REFC +c <@> leave[1 ref] vKP/REFC

Oddly, I can't reproduce it using

$ perl -e'use Devel::LeakTrace::Fast; { my $x = []; $x }' $

The two values being "leaked", incidentally, must be the reference and the array being referenced.


In reply to Re: question about Devel::LeakTrace::Fast by ikegami
in thread question about Devel::LeakTrace::Fast by perl5ever

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.