It's as if the arrays aren't getting garbage collected, but I've examined the reference count just prior to the reference leaving scope and it only has one reference (using Devel::Peek Dump).

Oh look, a reference count of 1 :)

my @one; my @two; my @three; push @two, \@three; push @three,\@two; push @one, \@two, \@three; use Devel::Peek; Dump(\@one ); __END__ SV = RV(0x3e8a90) at 0x3e8a84 REFCNT = 1 FLAGS = (TEMP,ROK) RV = 0x98a404 SV = PVAV(0x3e995c) at 0x98a404 REFCNT = 2 FLAGS = (PADMY) ARRAY = 0x997dec FILL = 1 MAX = 3 ARYLEN = 0x0 FLAGS = (REAL) Elt No. 0 SV = RV(0x98a4b0) at 0x98a4a4 REFCNT = 1 FLAGS = (ROK) RV = 0x98a424 SV = PVAV(0x3e9b84) at 0x98a424 REFCNT = 3 FLAGS = (PADMY) ARRAY = 0x9b1d7c FILL = 0 MAX = 3 ARYLEN = 0x0 FLAGS = (REAL) Elt No. 0 SV = RV(0x3e8b30) at 0x3e8b24 REFCNT = 1 FLAGS = (ROK) RV = 0x98a444 Elt No. 1 SV = RV(0x3e8970) at 0x3e8964 REFCNT = 1 FLAGS = (ROK) RV = 0x98a444 SV = PVAV(0x3e9b9c) at 0x98a444 REFCNT = 3 FLAGS = (PADMY) ARRAY = 0x994b2c FILL = 0 MAX = 3 ARYLEN = 0x0 FLAGS = (REAL) Elt No. 0 SV = RV(0x3e8b80) at 0x3e8b74 REFCNT = 1 FLAGS = (ROK) RV = 0x98a424

In reply to Re: Running out of Memory by Anonymous Monk
in thread Running out of Memory by nwboy74

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.