in reply to Why I got nearly out of memory, and never recover from that?
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).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Why I got nearly out of memory, and never recover from that?
by Marshall (Canon) on Jun 16, 2009 at 07:12 UTC | |
by llancet (Friar) on Jun 16, 2009 at 07:20 UTC | |
by Corion (Patriarch) on Jun 16, 2009 at 07:27 UTC | |
by JavaFan (Canon) on Jun 16, 2009 at 09:31 UTC |