mreece has asked for the wisdom of the Perl Monks concerning the following question:
specifically, a question regarding conflicting answers to the FAQ "How can I free an array or hash so my program shrinks?"
according to http://perldoc.perl.org/perlfaq3.html (which claims to be Perl 5.8.8 documentation):
You usually can't. Memory allocated to lexicals (i.e. my() variables) cannot be reclaimed or reused even if they go out of scope. It is reserved in case the variables come back into scope. Memory allocated to global variables can be reused (within your program) by using undef()ing and/or delete().however, according to 'perldoc perlfaq3' on my perl 5.8.6,
However, judicious use of my() on your variables will help make sure that they go out of scope so that Perl can free up that space for use in other parts of your program.is one of these incorrect or outdated? or are they both correct for their respective versions?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl memory re-usage
by Corion (Patriarch) on Aug 08, 2006 at 20:56 UTC | |
by perrin (Chancellor) on Aug 08, 2006 at 21:15 UTC | |
by Joost (Canon) on Aug 08, 2006 at 21:51 UTC | |
|
Re: perl memory re-usage
by eyepopslikeamosquito (Archbishop) on Aug 08, 2006 at 21:45 UTC | |
by mreece (Friar) on Aug 09, 2006 at 15:28 UTC | |
|
Re: perl memory re-usage
by radiantmatrix (Parson) on Aug 09, 2006 at 20:16 UTC | |
by BrowserUk (Patriarch) on Aug 09, 2006 at 22:00 UTC | |
by ikegami (Patriarch) on Aug 09, 2006 at 23:03 UTC | |
by mreece (Friar) on Aug 09, 2006 at 21:19 UTC | |
|
Re: perl memory re-usage
by perrin (Chancellor) on Aug 08, 2006 at 21:16 UTC | |
by ikegami (Patriarch) on Aug 08, 2006 at 21:22 UTC | |
by perrin (Chancellor) on Aug 08, 2006 at 21:35 UTC | |
by ikegami (Patriarch) on Aug 08, 2006 at 21:41 UTC |