Perl: the Markov chain saw | |
PerlMonks |
How clever is the garbage collector?by Moron (Curate) |
on Jun 07, 2006 at 12:33 UTC ( [id://554018]=perlquestion: print w/replies, xml ) | Need Help?? |
Moron has asked for the wisdom of the Perl Monks concerning the following question:
...or more specifically, I have a class TestSequence, which has two relevant methods to my question:
Now suppose we create some low-level data and later prune higher up the tree: Does anyone know if the delete (in method prune) will release the memory used by the one million hashes in this example? Or does it just release the memory used by the single node that is explicitly deleted, $sq -> { BB } in this case? Would the same be true if the one million hashes were replaced by references to one million objects from some other class (assuming the array referenced by $sq -> { BB } contains the only remaining references to those objects)? (Updated to take into account that ref(object) returns class name - an omission in the example code written from memory that isn't in fact in the real code) Thanks in advance, -M Free your mind
Back to
Seekers of Perl Wisdom
|
|