[Israel.pm] Garbage Collection Question

Issac Goldstand margol at beamartyr.net
Sat May 8 12:19:51 PDT 2004


Even if the GC does collect it AFAIK it will not release the memory back to
the system until Perl exits - rather it will save the memory for other
variables (or anything else in the Perl process which wants it).  Maybe I'm
remembering wrong, though...

  Yitzchak

----- Original Message ----- 
From: "Shlomo Yona" <shlomo at cs.haifa.ac.il>
To: "Perl in Israel" <perl at perl.org.il>
Sent: Saturday, May 08, 2004 5:40 PM
Subject: Re: [Israel.pm] Garbage Collection Question


> On Sat, 8 May 2004, Yuval Yaari wrote:
>
> > Will Perl automagically get rid of $file after the last line I used it
in
> > (in case reference count == 0, of course), or would it be better to set
it
> > to undef?
>
> Depending on the scope of $file.
> If $file is still in scope, then Perl's garbage collector will not touch
it.
> That is because there is no count 0 for that chunk of
> memory.
>
> Setting the scalar to under fill, however, be useful in some
> implementations of Perl, as it will set the reference count
> to 0.
>
> -- 
> Shlomo Yona
> shlomo at cs.haifa.ac.il
> http://cs.haifa.ac.il/~shlomo/
>
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://www.perl.org.il/mailman/listinfo/perl
>




More information about the Perl mailing list