How does Perl manage memory? Does an object be automatically released, if it is only refered as a local variable within a block?
Yes, it's released, but not given back to the operating system. Which means that the memory can be used for other Perl variables, but not from other processes.
Another question: In loop conditions, after each time of run, does the memory of local variables -- which are inited within the loop BODY(not the heading of loop) -- being deleted and released, and recreated next time?
Yes. (Although there's an optimization which takes care that only the contents of the variable are deleted, not the variable itself).
In reply to Re: Why I got nearly out of memory, and never recover from that?
by moritz
in thread Why I got nearly out of memory, and never recover from that?
by llancet
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |